Skip to content

fix(android): update JNI androidQuery bucket name to aw-watcher-android#632

Merged
ErikBjare merged 2 commits into
ActivityWatch:masterfrom
0xbrayo:fix-android-query-bucket
Jul 18, 2026
Merged

fix(android): update JNI androidQuery bucket name to aw-watcher-android#632
ErikBjare merged 2 commits into
ActivityWatch:masterfrom
0xbrayo:fix-android-query-bucket

Conversation

@0xbrayo

@0xbrayo 0xbrayo commented Jul 14, 2026

Copy link
Copy Markdown
Member

Closes ActivityWatch/aw-android#191

This fixes an issue introduced in #628 where the legacy '-test' suffix was dropped from buckets but not from the query.

…ucket name

This fixes an issue introduced in ActivityWatch#628 where the legacy '-test' suffix was dropped from buckets but not from the query.
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates Android bucket lookup to use the current watcher bucket name. The main changes are:

  • Android JNI queries now use aw-watcher-android instead of the old test bucket name.
  • Bucket lookup now prefers an exact bucket ID match.
  • Bucket lookup still falls back to the first matching prefix when no exact match exists.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
aw-server/src/android/mod.rs Updates the Android query bucket constant to the current watcher bucket name.
aw-transform/src/find_bucket.rs Changes bucket resolution to prefer exact matches while keeping prefix fallback.

Reviews (2): Last reviewed commit: "fix(query): prefer exact match in find_b..." | Re-trigger Greptile

// Hardcoded bucket ID for testing
let bid_android = "aw-watcher-android-test".to_string();
// Hardcoded bucket ID
let bid_android = "aw-watcher-android".to_string();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unmigrated Buckets Stop Querying

When androidQuery runs before migrateWatcherAndroidBucketNames has renamed existing aw-watcher-android-test... buckets, the new aw-watcher-android filter no longer matches the only stored Android watcher bucket. That makes the JNI query return an error JSON instead of the user's events until the separate migration entry point has run successfully.

@0xbrayo 0xbrayo changed the title fix(android): update JNI androidQuery to use new aw-watcher-android b… fix(android): update JNI androidQuery bucket name to aw-watcher-android Jul 14, 2026
@0xbrayo

0xbrayo commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

@TimeToBuildBob review

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.72%. Comparing base (656f3c9) to head (626a555).
⚠️ Report is 74 commits behind head on master.

Files with missing lines Patch % Lines
aw-transform/src/find_bucket.rs 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #632      +/-   ##
==========================================
+ Coverage   70.81%   75.72%   +4.90%     
==========================================
  Files          51       62      +11     
  Lines        2916     5033    +2117     
==========================================
+ Hits         2065     3811    +1746     
- Misses        851     1222     +371     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ErikBjare

Copy link
Copy Markdown
Member

@greptileai review

@ErikBjare
ErikBjare merged commit 0094c14 into ActivityWatch:master Jul 18, 2026
8 checks passed
@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Code review looks good to me. The two changes complement each other well:

  1. aw-server/src/android/mod.rs — correctly updates the hardcoded query bucket from the legacy aw-watcher-android-test to aw-watcher-android, aligning it with the name change introduced in feat(android): add migration for aw-watcher-android-test bucket names #628.

  2. aw-transform/src/find_bucket.rs — the refactored find_bucket logic is an improvement: it now prefers an exact ID match and only falls back to the first prefix match if no exact match is found. This prevents a bucket named aw-watcher-android-test from being returned when looking up aw-watcher-android (which would have been the old behavior once both buckets exist on a device that upgraded from the test name).

CI is green across all platforms and Greptile gave it 5/5. LGTM. Merge is Erik's call.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widget not displaying data.

3 participants