Skip to content

fix: match Zen browser in Firefox web watcher buckets#841

Open
pelevin-d-y wants to merge 1 commit into
ActivityWatch:masterfrom
pelevin-d-y:fix-zen-firefox-web-watcher
Open

fix: match Zen browser in Firefox web watcher buckets#841
pelevin-d-y wants to merge 1 commit into
ActivityWatch:masterfrom
pelevin-d-y:fix-zen-firefox-web-watcher

Conversation

@pelevin-d-y
Copy link
Copy Markdown

Summary

  • include Zen in the Firefox-compatible browser app regex
  • keep the existing dedicated Zen bucket support unchanged
  • add a unit test for Zen app names reported with Firefox web watcher buckets

Why

Zen Browser can use the Firefox WebExtension build of aw-watcher-web, which reports URL events into aw-watcher-web-firefox buckets. In that setup the window watcher reports the browser app as Zen, but the Firefox bucket query only accepted Firefox/LibreWolf/Waterfox/Nightly app names, so Browser view dropped those URL events.

Test

  • npx jest --selectProjects node test/unit/queries.test.node.ts --runInBand

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 25, 2026

Greptile Summary

This PR fixes Zen Browser URL events being silently dropped from the Browser view when Zen uses the Firefox WebExtension build of aw-watcher-web. The window watcher reports the app as Zen, but the Firefox bucket query only accepted Firefox/LibreWolf/Waterfox/Nightly app names, so no window events matched and the URL event intersection came up empty.

  • Adds zen to the firefox entry of browser_appname_regex in src/queries.ts; the existing dedicated zen browser entry and its own regex pattern are left intact, preserving native Zen bucket support.
  • Adds a unit test asserting that 'Zen' and 'Zen Browser' match the updated firefox regex.

Confidence Score: 5/5

A minimal, targeted fix that adds one alternative to an existing regex and a corresponding unit test. No behavioral changes for existing browser types.

The change is a single-token addition to an existing regex alternative group. It is verified by a new test, does not touch query generation logic, and Zen's dedicated bucket path remains unaffected.

No files require special attention.

Important Files Changed

Filename Overview
src/queries.ts Adds zen to the Firefox browser_appname_regex alternative so Zen Browser window events match Firefox-bucket URL queries; the existing dedicated zen pattern is left untouched.
test/unit/queries.test.node.ts Adds a focused regression test verifying the firefox regex matches both 'Zen' and 'Zen Browser'; test is minimal but correct for the documented scenario.

Sequence Diagram

sequenceDiagram
    participant WW as Window Watcher
    participant ZEN as Zen Browser
    participant FB as aw-watcher-web-firefox bucket
    participant Q as queries.ts (browserEvents)

    ZEN->>FB: URL events (via Firefox WebExtension)
    WW->>Q: "window events (app="Zen")"

    Note over Q: browsersWithBuckets finds aw-watcher-web-firefox
    Q->>Q: "events_firefox = flood(query_bucket(firefox_bucket))"
    Q->>Q: "window_firefox = filter_keyvals_regex(events, "app", "(?i)(firefox|...|zen)")"
    Note over Q: "Zen" now matches firefox pattern
    Q->>Q: "events_firefox = filter_period_intersect(url_events, window_firefox)"
    Q-->>Q: Zen URL events correctly attributed
Loading

Reviews (1): Last reviewed commit: "fix: match Zen in Firefox web watcher bu..." | Re-trigger Greptile

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.

1 participant