Repository navigation
aw-sync: sync failures are silent — add aw-sync status, loud diagnostics, per-device manifest, and surface peers in Raw Data #684
Description
Activity
- added a commit that references this issue
on Sep 15, 2026 Opened #687 for items 1–2 of this issue: fail-loud empty-pull warnings, plus
aw-sync status.aw-sync statusis read-only (no stagingtest.dbcreated, sqlite openedREAD_ONLYso it does not drop-wal/-shminto a Syncthing folder). It classifies both layouts, inspects peer dbs, and warns on duplicatedevice_id(#683), hostname mismatch, unpublished own staging, and unimported peers — the investigation that produced this issue, in one command.Not in that PR, still open here:
- per-device
manifest.json(item 3) - Raw Data /
aw-webuipeer surfacing (item 4) — different repo - walker unification (item 5) — fix(aw-sync): make default daemon use host-layout pull/push #685
- first-run /
test.dbrename (item 6) — status warns abouttest.db; it does not rename
#685 is the actual pull fix; #687 is the doctor. They touch the same files in different hunks and should merge either order.
- per-device
@TimeToBuildBob Correction to the last line above — #685 and #687 do not merge in either order:
#685 + #686 => CONFLICT aw-sync/src/util.rs #685 + #687 => CONFLICT aw-sync/src/util.rs (2 hunks, ~430 and ~180 lines) #686 + #687 => cleanMERGEABLEon each PR is only againstmaster. Full review on each PR; suggested order is #686 → #687 → #685 rebased, so the walkers consolidate ontoRemoteDbinstead of item 5 going the wrong way (the three PRs currently add five or six directory walks toutil.rsbetween them).- added 4 commits that reference this issue
on Sep 16, 2026 @ErikBjare You're right —
MERGEABLEwas only vs master, and the "either order" note was wrong. Reproduced:#685 + #686 => CONFLICT aw-sync/src/util.rs #685 + #687 => CONFLICT aw-sync/src/util.rs #686 + #687 => cleanResequenced as you asked:
- fix(aw-sync): skip duplicate device_id folders that truncate history on pull #686 first —
RemoteDbis the typed-peer walker. 3-level-only is explicit (comment + test). Deadget_remotes/contains_db_file/contains_subdir_with_db_filetrio removed here, not on fix(aw-sync): make default daemon use host-layout pull/push #685. - feat(aw-sync): add
statusdoctor command and fail-loud empty-pull warnings #687 on top of that —statusconsumeslist_remote_dbs+select_remote_dbs_by_device_id; leftover 2-level / unrecognised entries sit on top of that list. - fix(aw-sync): make default daemon use host-layout pull/push #685 rebased last — daemon host-layout switch +
Option<Datastore>staging fix only. Walker rewrite dropped.
All three now merge clean in any pairing. Still pull-only on this repo, so they need a maintainer click. Suggested order remains #686 → #687 → #685.
ActivityWatch/aw-android#272 is still the source of the duplicate folders #686 defends against.
Still open on this issue: per-device
manifest.json(item 3) and Raw Data peer surfacing (item 4, aw-webui).- fix(aw-sync): skip duplicate device_id folders that truncate history on pull #686 first —
- added a commit that references this issue
on Sep 16, 2026 - added a commit that references this issue
on Sep 16, 2026 - added a commit that references this issue
on Sep 16, 2026 Loop closed on the remaining items, now that #687 merged and this issue is closed:
- Items 1–2 (
aw-sync status+ fail-loud empty-pull): shipped in feat(aw-sync): addstatusdoctor command and fail-loud empty-pull warnings #687 (988e606) - Item 5 (typed walker /
RemoteDb): shipped in fix(aw-sync): skip duplicate device_id folders that truncate history on pull #686 - fix(aw-sync): make default daemon use host-layout pull/push #685 stays parked (DIRTY) per Sync: tracking issue and v0.14.0 release triage activitywatch#1445 — not restacking it
- Items 3–4 (per-device manifest, Raw Data peer surfacing) stay on the post-v0.14.0 sequence already written on Sync: tracking issue and v0.14.0 release triage activitywatch#1445: feat(aw-sync): return and persist a SyncReport from each pass #699 SyncReport → manifest → … Not filing duplicate issues.
Nothing further on this thread.
- Items 1–2 (
Setting up sync and having it silently do nothing is currently indistinguishable, from the user's side, from setting it up correctly. Two concrete bugs that produce exactly that are filed separately (#682 daemon layout mismatch, #683 duplicate-folder truncation) — this issue is about the fact that neither was diagnosable without reading the source and opening the peer sqlite files by hand.
In the case that prompted this, the daemon ran 102 sync passes over ~19 hours, logged
Pulling...102 times, imported nothing, and reported no problem at any level: not in the log, not in the UI, not in the sync folder.1. Fail loud
sync_run()logsPulling...unconditionally and then iterates an empty vec. It only logs when remotes are found:Finding zero peers in a directory the user explicitly configured for sync is the interesting case, not the boring one. It should
warn!with the glob that was tried and the directory entries that were skipped and why. Same for a peer database that fails to open, or whose schema version is unrecognised (there is already aTODO: Check for compatible remote db version before opening).2.
aw-sync statusA doctor subcommand, dumping in one screen:
hostname+device_id, target server + portdevice_id, hostname as recorded on its buckets, db size, bucket count, newest event timestamp, and whether it has been imported locallydevice_id, folder name ≠ bucket hostname, staging copy older than the local server's newest event, peers not importedlist_buckets()is already 80% of the data-gathering for this; it just isn't reachable in a form that answers "why is my phone missing".This one command replaces the entire manual investigation that produced these issues.
3. Per-device
manifest.jsonWrite a small JSON file next to each
test.db:{ "device_id": "41662faa-...", "hostname": "poco_f8_ultra", "display_name": "POCO F8 Ultra", "aw_version": "v0.14.2b1", "last_push": "2026-09-14T19:54:12Z", "buckets": [{"id": "aw-watcher-android", "events": 1027343, "last_event": "..."}] }Cheap to write, and it buys:
device_idacross folders — aw-sync: duplicate folders for one device_id silently truncate history on pull #683 becomes detectable at read timehostnamecolumn, which is the root of the rename problem (Any way to rename the host? I want to merge my devices aw-android#133)statusand the UI can show "last pushed 3 days ago" for a peer that has stopped syncing4. Surface sync peers in the existing Raw Data page
Correction to an earlier draft of this: the "Devices" view already exists.
/buckets(Raw Data) groups by device via thebucketsByDevicegetter inaw-webui/src/stores/buckets.ts, shows hostname + device ID + "this device" badge + last-updated with a recency highlight + desktop/mobile icon, and already runs consistency checks per device:So the structure to extend is there, and
runChecksis the natural home for sync warnings. The gap is that the page can only see devices that already have buckets locally — it is built fromthis.buckets. A device that is present in the sync folder but failing to import is invisible on the one page a user would look at to find it, which is precisely the failure mode above.Proposed: expose sync-folder peers (from
manifest.json, or a/api/0/sync/peers-style endpoint) and render them on the same page as devices in a "in sync folder, not imported" state, with the reason. Plus arunChecksentry for "this device has not published to the sync folder since {date}" — which would have caught the 8-month-stale local staging copy on its own.5. Unify the two folder walkers
find_remotes()/find_remotes_nonlocal()/get_remotes()are three different directory walks with two different depth assumptions, and the source already carries// TODO: share logic with find_remotes and find_remotes_nonlocal. One walker returning a typedVec<Peer>— rather thanVec<PathBuf>that callers re-derive meaning from — removes the class of bug entirely.6. Smaller items
test.db— it reads as leftover test scaffolding in a directory users are told to inspect.…-synced-from-…buckets left over from before fix(sync): never re-sync buckets synced from another host #648; they are re-exported peer data that nothing prunes.autostart_modulesand no way to pick a sync directory, so getting to a working setup means finding the binary inside the.appbundle and knowing thatsyncanddaemonbehave differently.cc @TimeToBuildBob