fix(android): open Activity view with device hostname, not unknown - #250
Conversation
The left-swipe drawer and notification taps hardcoded /#/activity/unknown/, so visualizations used desktop defaults for a host with no Android buckets. The in-app hamburger already built /activity/<real-hostname> from buckets. Use the same sanitized device hostname as bucket creation.
Greptile SummaryThe PR replaces hardcoded
Confidence Score: 5/5The PR appears safe to merge, with device-hostname routing consistently applied across the affected navigation, bucket, and synchronization paths. The shared helper preserves existing hostname normalization while replacing the erroneous hardcoded Activity host, and the changed navigation paths continue to construct authenticated local dashboard URLs. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Android device name] --> B[deviceHostname]
B --> C[sanitizeDeviceHostname]
C --> D[Bucket hostname]
C --> E[Sync hostname]
C --> F[Activity route]
F --> G[Embedded ActivityWatch dashboard]
Reviews (1): Last reviewed commit: "fix(android): open Activity view with de..." | Re-trigger Greptile |
|
Greptile is 5/5 and the unit-test job passed. The Android 29 E2E job is still running, so no merge action is available yet; this repo is maintainer-merge only for Bob. |
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
Takes ActivityWatch#250 (shared DeviceHostname helper), ActivityWatch#242, ActivityWatch#234, ActivityWatch#244, ActivityWatch#248, ActivityWatch#245. Deliberately NOT taken: ActivityWatch#249's Kotlin half. It declares private external fun setDataDir(path: String) and calls it from SyncInterface's init block, but this fork's android.rs exports no Java_..._SyncInterface_setDataDir - the constructor would throw UnsatisfiedLinkError and SyncScheduler would disable itself, which is Blocker 6 verbatim. This fork already gets the same fix via XDG_DATA_HOME (step 1.0b), which needs no new JNI symbol. The refusal is documented at the call site so the next merge re-checks it. Submodule pointer kept at our fork (c6f7df2); upstream's 2ded7d7 has none of the aw-sync fixes from Phase 1. getDeviceName() now delegates to upstream's deviceHostname(), which is byte-for-byte equivalent to the implementation it replaces - no device directory in the shared folder changes name.
Problem
v0.14.0b2 user report on #247: the hamburger-menu Activity entry works, but the left-swipe drawer Activity item opens the same page with hostname
unknownand default (non-Android) visualizations.Cause: the drawer item and notification-tap path hardcoded
/#/activity/unknown/. The in-app hamburger builds/activity/<real-hostname>from buckets, so it gets Android views.unknownis a sentinel (stopwatch / missing host), not a device.Fix
/#/activity/<sanitized-device-hostname>/using the same hostname as Android bucket creation (Settings.Global.DEVICE_NAME/Build.DEVICE).RustInterfaceandSyncInterface.Does not close #247. Remaining there: sync UX/discoverability, last-sync / success-fail UI, category-import save persistence. Sync 401 is #249.
Testing
Passed (14 tests).