fix(android): load background settings from datastore - #237
Conversation
30c213e to
305ff9e
Compare
305ff9e to
f34f9a8
Compare
Greptile SummaryThe PR moves widget and notification-worker settings reads from unauthenticated localhost HTTP calls to the native datastore interface.
Confidence Score: 5/5The reviewed Kotlin changes appear safe to merge, with no concrete changed-code defect identified. The new datastore reads preserve the existing defaults, validate malformed day boundaries and alert data, run on background execution paths, and remain enclosed by the callers’ existing failure handling. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
W[Widget updater] --> RI[RustInterface.getSetting]
N[NotifyWorker] --> RI
RI --> DS[Native ActivityWatch datastore]
DS --> S[startOfDay]
DS --> A[aw-notify]
S --> WQ[Widget logical-day query]
S --> NQ[Notification logical-day query]
A --> NC[Notification threshold checks]
Reviews (1): Last reviewed commit: 30c213e | Re-trigger Greptile |
|
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. |
What
Why
Android enables bearer authentication by default. The widget and background worker did not send that token, so their localhost settings requests returned 401 (or failed when the HTTP server was down) and silently used defaults. The widget then classified the same events with different category rules than the Activity view.
ActivityWatch/aw-server-rust#653 fixes androidQuery by loading settings.classes from the datastore and adds the matching getSetting JNI method for the remaining background settings reads.
Verification
Deliberate scope
Refs #142. Device confirmation with custom categories remains before the issue itself is complete.