You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The phone's push staging db ({sync_dir}/{hostname}/{device_id}/test.db) still holds the copies written by pre-ActivityWatch/aw-server-rust#713 pushes: 293 of one finished stopwatch event, plus the counts from the desktop dry run on erb-m2 (android-test 155,316 of 306,738, android-unlock 4,797, android 2,349). #295 (bump to 70ba50d) stops the growth, but every fresh desktop import of this phone still pulls the existing copies once.
aw-sync dedupe does not reach this: it deliberately refuses non--synced-from- buckets, goes over the aw-server HTTP API (ms precision), and staging is a separate sqlite file that no server serves.
Proposal
The staging db is derived data (the local datastore is the source of truth), so drop it and re-stage rather than dedupe it in place:
JNI SyncInterface.resetStaging(hostname) in aw-sync/src/android.rs: delete test.db, test.db-wal, test.db-shm for the own device dir only. Resolve the path from the same get_sync_dir() + hostname/device id the push uses and refuse anything not under that dir. Never touch a peer's dir.
The next push rebuilds staging from the local datastore. Push resume is derived from the staging bucket's last event, so an empty staging means one full re-push (small on a phone).
Trigger choice for Erik: automatic one-shot (nobody has to know) versus a "Reset sync staging" button in Sync Settings. I lean automatic one-shot since there is no reason a user would ever decline it.
Verify before building
Confirm the phone's localandroid-test / android-unlock buckets are not themselves duplicated. If they are, re-staging reproduces the copies and the local buckets need the cleanup instead. Erik's dry run only proved the staging db matches the desktop counts.
Follow-up to ActivityWatch/aw-server-rust#717, item 2. Item 1 (
aw-sync dedupefor-synced-from-buckets on desktops) merged in ActivityWatch/aw-server-rust#718. This is the phone side.Problem
The phone's push staging db (
{sync_dir}/{hostname}/{device_id}/test.db) still holds the copies written by pre-ActivityWatch/aw-server-rust#713 pushes: 293 of one finished stopwatch event, plus the counts from the desktop dry run on erb-m2 (android-test155,316 of 306,738,android-unlock4,797,android2,349). #295 (bump to70ba50d) stops the growth, but every fresh desktop import of this phone still pulls the existing copies once.aw-sync dedupedoes not reach this: it deliberately refuses non--synced-from-buckets, goes over the aw-server HTTP API (ms precision), and staging is a separate sqlite file that no server serves.Proposal
The staging db is derived data (the local datastore is the source of truth), so drop it and re-stage rather than dedupe it in place:
SyncInterface.resetStaging(hostname)inaw-sync/src/android.rs: deletetest.db,test.db-wal,test.db-shmfor the own device dir only. Resolve the path from the sameget_sync_dir()+ hostname/device id the push uses and refuse anything not under that dir. Never touch a peer's dir.syncInFlightguard (never concurrent with a push), once, before the first push after upgrading to a build carrying fix(aw-sync): dedup boundary events on resume to prevent cursor re-imports (#711) aw-server-rust#713. Gate with a SharedPreferences flag so it doesn't repeat.Trigger choice for Erik: automatic one-shot (nobody has to know) versus a "Reset sync staging" button in Sync Settings. I lean automatic one-shot since there is no reason a user would ever decline it.
Verify before building
android-test/android-unlockbuckets are not themselves duplicated. If they are, re-staging reproduces the copies and the local buckets need the cleanup instead. Erik's dry run only proved the staging db matches the desktop counts.end_time + datafingerprint from fix(aw-sync): dedup boundary events on resume to prevent cursor re-imports (#711) aw-server-rust#713 covers re-imported rows). Worth one check on the real pair before calling it done.Out of scope: sync v2 makes this class impossible by construction (idempotency by source event id).