Background
#273 fixed the immediate hostname-fork issue by adding a one-shot migration (SanitizedHostnameMigration.kt, ~356 lines) that rewrites bucket hostname rows to the sanitized form before the datastore opens.
The root cause — sync identity is hostname-keyed, so any future sanitizer/casing change will fork again — is tracked in ActivityWatch/activitywatch#302 (device_id-keyed sync direction) and ActivityWatch/aw-server-rust#683 (aw-sync data-loss from duplicate folders).
Remaining work
When ActivityWatch/activitywatch#302 lands and aw-server-rust implements device_id-keyed sync, the migration machinery from #273 becomes obsolete and should be removed:
mobile/src/main/java/net/activitywatch/android/SanitizedHostnameMigration.kt (356 lines)
mobile/src/test/java/net/activitywatch/android/SanitizedHostnameMigrationTest.kt (327 lines)
- Remove calls to
SanitizedHostnameMigration in BackgroundService.kt and SyncInterface.kt
- Remove
HOSTNAME_MIGRATION_DONE preference key from AWPreferences.kt
Done when
SanitizedHostnameMigration.kt and its test deleted
- All callsites removed
- CI green
Depends on
Closes via: #272
Background
#273 fixed the immediate hostname-fork issue by adding a one-shot migration (
SanitizedHostnameMigration.kt, ~356 lines) that rewrites bucket hostname rows to the sanitized form before the datastore opens.The root cause — sync identity is hostname-keyed, so any future sanitizer/casing change will fork again — is tracked in ActivityWatch/activitywatch#302 (device_id-keyed sync direction) and ActivityWatch/aw-server-rust#683 (aw-sync data-loss from duplicate folders).
Remaining work
When ActivityWatch/activitywatch#302 lands and aw-server-rust implements device_id-keyed sync, the migration machinery from #273 becomes obsolete and should be removed:
mobile/src/main/java/net/activitywatch/android/SanitizedHostnameMigration.kt(356 lines)mobile/src/test/java/net/activitywatch/android/SanitizedHostnameMigrationTest.kt(327 lines)SanitizedHostnameMigrationinBackgroundService.ktandSyncInterface.ktHOSTNAME_MIGRATION_DONEpreference key fromAWPreferences.ktDone when
SanitizedHostnameMigration.ktand its test deletedDepends on
Closes via: #272