Skip to content

fix(sync): detect a missing sync engine and stop reporting false success (closes #209) - #211

Merged
gnacho merged 2 commits into
mainfrom
fix/209-missing-sync-engine
Sep 17, 2026
Merged

gnacho merged 2 commits into
mainfrom
fix/209-missing-sync-engine

Conversation

@gnacho

@gnacho gnacho commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Problem

nextsync delegates reconciliation to an external engine (nextcloudcmd / opencloudcmd). When that binary is not on $PATH:

  • real runs ended in the generic Failed ("Synchronization failed - view the log"), and
  • a periodic remote-interval run whose root ETag was unchanged took the ETag-gate shortcut (EngineRun::Direct(SyncOutcome::Success)) without ever resolving the engine - so the row reported "Synchronization completed" for days while nothing was actually synchronized.

The concrete trigger: removing the official Nextcloud desktop package (e.g. to stop its D-Bus/Nautilus auto-start, #208) also removes nextcloudcmd, and the app kept looking healthy.

Fix

  • engine_thread now builds the engine command before the remote ensurer and the ETag gate, mapping CommandError::MissingBinary to the new distinct outcome SyncOutcome::EngineMissing (other command errors keep the generic Failed).
  • resolve_binary treats an explicit executable override pointing at a path that no longer exists as MissingBinary too (a stale configured path surfaces the actionable state instead of an opaque spawn failure).
  • The scheduler maps EngineMissing to AppState::Error with a clear message ("Synchronization blocked: the sync engine is not installed"), never counts it as a success, and keeps retrying on every trigger - installing the engine package recovers without an app restart.
  • The outcome line goes to the daily log (outcome_log_line) and raises a desktop notification (failure_notification), so "view the log" is meaningful.
  • Spanish translations added; i18n catalog parity regenerated.

Tests (red-green)

  • missing_engine_blocks_the_etag_gate_success - unchanged ETag + missing binary must not report Success (was: Success without spawning anything).
  • missing_engine_reports_engine_missing_on_manual_run - manual run with a missing engine reports EngineMissing (was: Failed).
  • missing_binary_maps_to_failed updated: now expects EngineMissing (the old behavior this issue changes).
  • engine_missing_sets_error_and_recovers_on_retry - scheduler state, message mentions the engine, and recovery on the next trigger.
  • resolve_binary_rejects_a_missing_explicit_override, notifications coverage, outcome-log coverage.

Gate: 712 passed + 1 ignored (known flaky), clippy --all-targets clean, fmt clean, i18n parity diff clean.

Note

Local package built and running (0.2.22-1). With this merged, #208 becomes safe to execute.

@gnacho
gnacho merged commit 8b165fb into main Sep 17, 2026
2 checks passed
@gnacho
gnacho deleted the fix/209-missing-sync-engine branch September 17, 2026 18:33
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.

1 participant