fix(android): don't merge on 'title' key for aw-watcher-android buckets - #960
Conversation
Greptile SummaryThis PR restores source-specific event merging so Android events are retained while iOS ScreenTime title distinctions remain available.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
B[Selected mobile bucket] --> D{ScreenTime bucket?}
D -->|Yes| I[Set isIos true]
D -->|No| A[Use Android defaults]
I --> T[Merge by app and title]
A --> M[Merge by app]
T --> C[Categorization and summaries]
M --> C
Reviews (2): Last reviewed commit: "fix(android): pass isIos to categoryQuer..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #960 +/- ##
==========================================
+ Coverage 49.62% 50.25% +0.62%
==========================================
Files 46 46
Lines 2783 2790 +7
Branches 597 635 +38
==========================================
+ Hits 1381 1402 +21
+ Misses 1381 1309 -72
- Partials 21 79 +58 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@greptileai review |
|
The CI failure is not caused by this PR's changes — all 246 tests passed in the failing job. The failure is in the post-test "Print server logs to console" step, which exits non-zero because The other two matrix variants ( |
|
Root-caused and fixed in #962. The That is exactly why only this leg fails: the #962 globs both roots (restoring the diagnostics, which have been silently empty — note the |
|
Closed duplicate #964 in favor of this source-aware fix: #964's unconditional #960 remains the canonical fix. Its only red check is the pre-existing log-collection failure fixed and proven green in #962; I attempted a failed-job rerun, but this account lacks the repository admin permission GitHub requires for reruns. |
aw-watcher-android events carry 'app', 'package', 'classname' but NOT 'title'. merge_events_by_keys skips events missing any requested key, so the 'title' key added in bf0fc84 (for iOS ScreenTime compatibility) silently collapsed all Android Activity data to 0s. Fixes by gating the 'title' merge key on isIos (new optional field on AndroidQueryParams). The appQuery() caller in activity.ts already has iosBucket detection; it now passes isIos=true only for ScreenTime buckets. Verified against live bucket data (ActivityWatch#959): merge on ['app', 'title'] → 0.0 s merge on ['app'] → 4878.8 s (actual data) Regression from bf0fc84 (2026-07-24, iOS ScreenTime patch ActivityWatch#917). Not present in v0.14.0b2 (pins aw-webui 749585f, pre-regression). Affects master builds and any aw-webui >= bf0fc84 rendering Android buckets. Closes ActivityWatch#959 Git-Session-Id: b5092fb7-a3f0-5a15-8da3-fd21d8d7f2a8
…ime callers The primary appQuery path was fixed in the initial commit, but two callers still omitted isIos when passing an aw-import-screentime bucket to categoryQuery (via query_category_time_by_period) and canonicalEvents (via CategoryBuilder). Without isIos=true, canonicalEvents merges iOS events only by ['app'] instead of ['app', 'title'], losing title distinctions before category assignment and phrase extraction. Fix: - activity.ts query_category_time_by_period: detect iosBucketForCategory and pass isIos: !!iosBucketForCategory alongside bid_android in the categoryQuery params - CategoryBuilder.vue: pass isIos: !!screentimeBucket in the bucketParams spread Tests: add categoryQuery merge key regression describe block covering both Android (no title) and iOS (with title) paths. Git-Session-Id: b5092fb7-a3f0-5a15-8da3-fd21d8d7f2a8
be4a200 to
08b925c
Compare
|
#962 is merged. I rebased this branch onto it, which triggered fresh CI with the log-collection fix included. The local node suite passes (162 tests); waiting for the fresh GitHub checks and maintainer review/merge. |
|
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. |
Problem
Regression from bf0fc84 ("fix(ios): screentime compatibility patch", 2026-07-24, #917):
aw-watcher-androidevents carryapp,package,classname— notitlekey.merge_events_by_keysin aw-server-rust skips any event missing a requested key (continue 'event), so this one change silently drops every Android event and the Activity view reportsTime active: 0s+Top Applications: No data.Measured on a live bucket (same bucket, same day):
merge_events_by_keys(events, ["app", "title"])merge_events_by_keys(events, ["app"])The same
"title"addition appears inappQuery'stitle_eventsstep at line 240.Not present in v0.14.0b2 (pins
aw-webui 749585f, 2026-07-22 — two days before bf0fc84). Affects master builds and any aw-webui ≥ bf0fc84 that rendersaw-watcher-androidbuckets.Reported by Judemasic in ActivityWatch/aw-android#247, full analysis in #959.
Fix
Add an optional
isIos?: booleanfield toAndroidQueryParams. TheappQuery()caller inactivity.tsalready detects the ScreenTime bucket (iosBucket) — it now passesisIos=trueonly for those buckets.["app"]/["app", "classname"]["app", "title"]/["app", "classname", "title"]Tests
Added a regression test to
test/unit/queries.test.node.tsverifying that:appQuery(..., isIos=false)does not include"title"in merge keysappQuery(..., isIos=true)does include"title"(iOS path unchanged)Closes #959