feat(android): migrate unknown hostname#577
feat(android): migrate unknown hostname#5770xbrayo wants to merge 2 commits intoActivityWatch:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #577 +/- ##
==========================================
- Coverage 70.81% 66.91% -3.90%
==========================================
Files 51 54 +3
Lines 2916 3195 +279
==========================================
+ Hits 2065 2138 +73
- Misses 851 1057 +206 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@greptile-apps review |
Greptile SummaryThis PR adds a hostname migration feature for Android, allowing buckets previously created with Key findings:
Confidence Score: 4/5Not safe to merge until the JNI symbol name is corrected — the entry point will silently fail to link at runtime. The datastore and worker layers are correctly implemented. The sole blocking issue is in the JNI symbol name, which will prevent the Android side from ever calling the function. Once that is fixed (a one-line rename), the remaining findings are minor P2 quality improvements. aw-server/src/android/mod.rs — the JNI function symbol name must be corrected before this can be used from Android. Important Files Changed
Sequence DiagramsequenceDiagram
participant Android as Android/Kotlin
participant JNI as JNI (mod.rs)
participant DS as Datastore (worker.rs)
participant DSI as DatastoreInstance (datastore.rs)
participant SQLite as SQLite DB
Android->>JNI: migrate_hostname(hostname)
JNI->>DS: migrate_hostname(&hostname)
DS->>DS: send Command::MigrateHostname(hostname)
DS->>DSI: migrate_hostname(conn, new_hostname)
DSI->>SQLite: UPDATE buckets SET hostname=?1 WHERE hostname='unknown' OR hostname='Unknown'
SQLite-->>DSI: rows_updated (n)
alt n > 0
DSI->>SQLite: SELECT * FROM buckets (get_stored_buckets)
SQLite-->>DSI: fresh bucket rows
DSI->>DSI: refresh buckets_cache
DSI-->>DS: Ok(n)
DS->>DS: self.commit = true
else n == 0
DSI-->>DS: Ok(0)
end
DS-->>JNI: Response::Count(n)
JNI-->>Android: "Migrated hostname for N bucket(s)"
Reviews (1): Last reviewed commit: "feat(android): migrate unknown hostname" | Re-trigger Greptile |
cf2b78d to
6a16914
Compare
6a16914 to
89b8cec
Compare
Fixes ActivityWatch/aw-android#149.