Skip to content

Mark folder offline after N consecutive failed syncs regardless of error class #179

Description

@gnacho

Problem

The folder/account offline state is only reached through SyncOutcome::NetworkError (#162), i.e. when the remote ensurer gets a transport error. Other persistent failure modes - HTTP 5xx from the server, WebDAV errors, a broken reverse proxy, repeated engine crashes - keep ending as Failed forever: the summary still reads "Connected" and the folder retries on every trigger without ever telling the user the account is effectively unreachable.

Reference pattern: Iotas

Iotas keeps a SYNC_FAIL_OFFLINE_THRESHOLD = 2 counter: two consecutive failed sync runs flag offline = true (shown in the UI), and the next successful run clears it ("Recovered connectivity"). Simple, and it covers every error class without having to classify each one.

Proposal

  • Count consecutive Failed (and NetworkError) outcomes per folder scheduler.
  • After N consecutive failures (N=2 or 3), transition to the existing Offline state with a message like "Synchronization is failing repeatedly - check the server".
  • Reset the counter on any outcome that ran the engine (Success / Conflict).
  • Keep the existing per-error states (AuthFailed, KeyringLocked, DeleteReview) taking precedence as they do today.

Acceptance criteria

  • Two consecutive Failed outcomes move the folder to Offline
  • A later Success clears the flag and the counter
  • AuthFailed / KeyringLocked / DeleteReview still win over Offline
  • Tests: counter increments only on back-to-back failures, resets on success

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions