Skip to content

Remove SanitizedHostnameMigration once device_id-keyed sync lands (follow-up to #273) #302

Description

@TimeToBuildBob

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions