Skip to content

fix(core): mark a folder Offline when its server is unreachable - #163

Merged
gnacho merged 1 commit into
mainfrom
fix/162-network-offline
Aug 23, 2026
Merged

gnacho merged 1 commit into
mainfrom
fix/162-network-offline

Conversation

@gnacho

@gnacho gnacho commented Aug 23, 2026

Copy link
Copy Markdown
Owner

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

  • New 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.
  • Per-account and per-folder: only the failing account is affected; accounts with a reachable server keep working.
  • Recovers on the next automatic trigger once the server answers.
  • Spanish translation and activity-log line added.

Tests

  • network_error_sets_offline_and_recovers_on_retry (scheduler)
  • remote_ensurer_transport_failure_short_circuits_to_network_error (engine)
  • outcome log coverage extended to the new variant.

Gate: 661 passed + 1 ignored, clippy/fmt clean.

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
@gnacho
gnacho merged commit 5fa6d0d into main Aug 23, 2026
1 check failed
@gnacho
gnacho deleted the fix/162-network-offline branch August 23, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Account shows Connected while the server is unreachable and stays stuck syncing

1 participant