fix(sync): suppress desktop 'zero peers' warning in Sync Settings; show push-only note - #293
Conversation
…h-only note On Android pull is a no-op by construction (SAF mirror is outbound-only), so aw-server-rust#687's 'zero peers in a configured sync dir is usually a layout or setup problem' warning is always present but meaningless. It causes users to think sync is broken when it is working as expected. Per ActivityWatch#291 (re-scope): Android stays push-only until sync v2 ships (JSONL+zstd read-from-staging). In the meantime Sync Settings - filters the 'zero peers' warning (isPushOnlyDevice=true at the call site) - appends 'Push-only on this device (pull arrives with sync v2)' to every last-sync status display so users understand why pull counts are always 0 All existing tests pass unchanged (new parameter defaults to false). Three new tests cover the main case, warning preservation, and null status. Git-Session-Id: fbd0
|
…f (run 35347943017) Git-Session-Id: 2b5c2082-6682-54f6-904f-167976400e00
|
The E2E failure on the The PR only touches I don't have write access to re-trigger CI. Requesting a re-run of the failed job — the unit tests all pass and Greptile gave it 5/5. |
Summary
Closes #291 (re-scoped on 2026-09-18 by Erik).
On Android, pull is a no-op by construction — the SAF mirror is outbound-only so
pull_all()always finds zero peers. This causes aw-server-rust#687's"zero peers in a configured sync dir is usually a layout or setup problem" warning
to appear in Sync Settings on every run, misleading users into thinking sync is broken.
Per the re-scope: Android stays push-only until sync v2 (JSONL+zstd
read-from-staging). Until then Sync Settings should:
why pull counts are always 0
Changes
SyncSettingsActivity.ktformatSyncStatusandformatSyncDetailgain anisPushOnlyDevice: Boolean = falseparameter (default
false— all non-Android call sites are unchanged)isPushOnlyDevice = true:"zero peers"are filtered from the detail line"Push-only on this device (pull arrives with sync v2)"is appended to everylast-sync status display (including the "Last sync: never" initial state)
updateLastSyncStatus()now passesisPushOnlyDevice = trueSyncSettingsActivityTest.kt— 3 new unit tests:formatSyncStatus_pushOnlyDevice_suppressesZeroPeersWarning— zero-peers warning filtered, push-only note appendedformatSyncStatus_pushOnlyDevice_preservesOtherWarnings— other warnings (e.g. "push aborted after pull failure") still surfaceformatSyncStatus_pushOnlyDevice_appendsNoteEvenWhenNeverSynced— note appears even before the first syncItem 2: JNI sync dir root verification
Erik's re-scope also asks to verify what root
getSyncDir()returns at the JNI boundary(
…/files/syncvs…/files/sync/poco_f8_ultra). That diagnostic is tracked as afollow-up: running the app on device and reading
Log.d "getSyncDir()"from logcat beforethe v2 reader is designed. Not included in this UI-only PR.
Test plan
./gradlew :mobile:testDebugUnitTestpasses (unit tests are pure JVM, no emulator needed)