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
Filed out of discussion in ActivityWatch/aw-server-rust#630, which traced Android native OOM crashes to an unbounded event fetch in sync_one().
In that thread @ErikBjare asked the right follow-up: what does the user actually do to get their Android and desktop data synced? The answer is: there is no user-facing setup flow, and the underlying mechanism is blocked by Android storage restrictions.
Current state (Android sync, as implemented)
Android sync dir is resolved as Android/data/net.activitywatch.android/files/sync/ (set via AW_SYNC_DIR env var in SyncInterface.kt). The sync DB structure mirrors desktop: {hostname}/{device_id}/*.db.
Pull (pull_all): Android scans sync_dir for {hostname}/{device_id}/*.db files from OTHER devices. There is no mechanism to get those files onto the phone. On desktop, users share ~/ActivityWatchSync via Syncthing/Dropbox/etc. On Android, the app's data dir (Android/data/...) is scoped storage — not accessible to other apps since Android 11+, so Syncthing cannot write into it, making the typical desktop sync flow non-replicable on mobile.
In practice: pull_all() silently no-ops on a typical Android device (no remote db files found). Push works, but the data stays trapped on the phone.
Problems to fix
Sync disabled by default on Android — automatic sync fires every 15 min (via SyncScheduler), potentially crashing (OOM) or consuming battery/I/O for work that is currently pointless. It should be off by default, with a setting to enable it.
Android sync directory is not accessible via Syncthing/standard apps — the app data dir is scoped to the app. For Android sync to work at all, either:
The app needs to use a user-accessible location (e.g., a user-picked directory via Storage Access Framework / ACTION_OPEN_DOCUMENT_TREE)
Or provide its own sync transport (Bluetooth, local Wi-Fi, explicit export/share flow)
No setup UI — no settings screen, no documentation, no in-app explanation of how sync works or what the user needs to do.
SyncScheduler runs unconditionally — no check for whether sync is configured, no user-accessible enable/disable toggle.
Suggested next steps (not prescriptive — up to maintainers)
Add a settings toggle to enable/disable automatic sync (default: off)
Consider Storage Access Framework for Android sync dir (user picks a directory accessible to both the app and Syncthing/etc.)
Add a sync status/setup screen explaining the current sync dir path and what users need to do
Document the intended mobile sync flow somewhere visible
Background
Filed out of discussion in ActivityWatch/aw-server-rust#630, which traced Android native OOM crashes to an unbounded event fetch in
sync_one().In that thread @ErikBjare asked the right follow-up: what does the user actually do to get their Android and desktop data synced? The answer is: there is no user-facing setup flow, and the underlying mechanism is blocked by Android storage restrictions.
Current state (Android sync, as implemented)
Android sync dir is resolved as
Android/data/net.activitywatch.android/files/sync/(set viaAW_SYNC_DIRenv var inSyncInterface.kt). The sync DB structure mirrors desktop:{hostname}/{device_id}/*.db.push_with_hostname): Android writes its own events intosync_dir/{device_name}/{device_id}/*.db. This works in isolation (modulo the OOM bug in App doesn't open after installing it and opening it (Mac OS Big Sur) #630).pull_all): Android scanssync_dirfor{hostname}/{device_id}/*.dbfiles from OTHER devices. There is no mechanism to get those files onto the phone. On desktop, users share~/ActivityWatchSyncvia Syncthing/Dropbox/etc. On Android, the app's data dir (Android/data/...) is scoped storage — not accessible to other apps since Android 11+, so Syncthing cannot write into it, making the typical desktop sync flow non-replicable on mobile.In practice:
pull_all()silently no-ops on a typical Android device (no remote db files found). Push works, but the data stays trapped on the phone.Problems to fix
Sync disabled by default on Android — automatic sync fires every 15 min (via
SyncScheduler), potentially crashing (OOM) or consuming battery/I/O for work that is currently pointless. It should be off by default, with a setting to enable it.Android sync directory is not accessible via Syncthing/standard apps — the app data dir is scoped to the app. For Android sync to work at all, either:
ACTION_OPEN_DOCUMENT_TREE)No setup UI — no settings screen, no documentation, no in-app explanation of how sync works or what the user needs to do.
SyncScheduler runs unconditionally — no check for whether sync is configured, no user-accessible enable/disable toggle.
Suggested next steps (not prescriptive — up to maintainers)
Related
aw-android/mobile/src/main/java/net/activitywatch/android/SyncInterface.kt— sync dir setupaw-android/mobile/src/main/java/net/activitywatch/android/SyncScheduler.kt— 15-min auto-sync timer