fix(core): mark a folder Offline when its server is unreachable - #163
Merged
Merged
Conversation
The offline state was only driven by the GLib NetworkMonitor, so an account whose server did not answer (e.g. a dynamic IP that stopped resolving) stayed Connected and its folders kept spinning in a waiting/syncing loop while nextcloudcmd hung against the unreachable host. Map a server transport failure during the remote-folder ensure step to a new SyncOutcome::NetworkError: the scheduler marks that folder Offline and never launches nextcloudcmd against an unreachable server. The state is per-account and per-folder, so accounts with a reachable server keep working. Recovering happens on the next automatic trigger once the server answers. Closes #162
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #162: an account whose server is unreachable (e.g. a dynamic IP that stops resolving) kept showing Connected, and its folders were stuck in a waiting/syncing loop while nextcloudcmd hung against the unreachable host.
Root cause
The Offline state was only driven by the GLib NetworkMonitor (the machine network link). When the machine had network but the specific server did not answer, the folder never went Offline: the account summary text returned Connected for every state except Offline, and nextcloudcmd ran without a timeout against the dead host.
Change
SyncOutcome::NetworkError: a server transport failure during the remote-folder ensure step (MKCOL) marks that folder Offline and does not launch nextcloudcmd against an unreachable server.Tests
network_error_sets_offline_and_recovers_on_retry(scheduler)remote_ensurer_transport_failure_short_circuits_to_network_error(engine)Gate: 661 passed + 1 ignored, clippy/fmt clean.