fix: match Helium with chrome web watcher bucket#898
Conversation
Greptile SummaryThis PR adds
Confidence Score: 4/5Safe to merge for the common case; a narrow edge case exists where users with both a Chrome-extension bucket and a Helium-native bucket could see URL visits counted twice. The regex change is minimal and correctly scoped to the chrome bucket filter. The test additions are appropriate. The only concern is that The Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Active window app: Helium] --> B{Which web-watcher bucket exists?}
B -->|aw-watcher-web-chrome_* only| C[chrome regex matches Helium\nvia new helium alternation]
B -->|aw-watcher-web-helium_* only| D[helium regex matches Helium\nvia existing unanchored pattern]
B -->|Both buckets present| E[Both regexes match Helium]
C --> F[URL events counted under Chrome browser entry]
D --> G[URL events counted under Helium browser entry]
E --> H[URL events counted TWICE\nonce under Chrome, once under Helium]
style H fill:#ffcccc,stroke:#cc0000
style F fill:#ccffcc,stroke:#006600
style G fill:#ccffcc,stroke:#006600
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Active window app: Helium] --> B{Which web-watcher bucket exists?}
B -->|aw-watcher-web-chrome_* only| C[chrome regex matches Helium\nvia new helium alternation]
B -->|aw-watcher-web-helium_* only| D[helium regex matches Helium\nvia existing unanchored pattern]
B -->|Both buckets present| E[Both regexes match Helium]
C --> F[URL events counted under Chrome browser entry]
D --> G[URL events counted under Helium browser entry]
E --> H[URL events counted TWICE\nonce under Chrome, once under Helium]
style H fill:#ffcccc,stroke:#cc0000
style F fill:#ccffcc,stroke:#006600
style G fill:#ccffcc,stroke:#006600
|
Summary
Heliumfor Chrome web watcher buckets when no dedicated Helium bucket exists.Heliumthrough the Chrome bucket when anaw-watcher-web-helium_*bucket is also present.Why
Helium can install and run the Chrome Web Store ActivityWatch extension, which reports URL events into an
aw-watcher-web-chrome_*bucket. In that setup, the active window app name isHelium, so the Chrome bucket filter would otherwise drop those browser events even though the data exists.The PR now also guards the edge case where both a Chrome-extension bucket and a dedicated Helium bucket are present, so the same Helium browsing activity is not claimed by both browser paths.
Test
npm test -- --selectProjects node --runTestsByPath test/unit/queries.test.node.ts npx prettier --check src/queries.ts test/unit/queries.test.node.ts