WebWatcher: keyboard events still split visits in detected browsers (browserIsActiveWindow checks only the hard-coded list)
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Read watcher/WebWatcher.kt:318-325 and compare browserIsActiveWindow with isKnownBrowser and the active detected browser check around lines 229-230. Use the provided Robolectric keyboard event test as the starting point; the issue says the test harness is WebWatcherDestroyTest. Done means the test passes and keyboard events no longer split visits for active detected browsers.
Written by the indexing model from the issue text.
Description
browserIsActiveWindow() (watcher/WebWatcher.kt:318-325) checks only KNOWN_BROWSER_PACKAGES. Visits are also opened for runtime-detected browsers (detectedBrowsers + probeMemory.isActive, lines 229-230). So for Vivaldi, DuckDuckGo, Kiwi and other detected browsers, any keyboard or overlay event from another window ends the visit (lines 239-242). That is the split #342 fixed, and the fix only applies to the hard-coded list.
This is deterministic and doesn't depend on any event's source node.
Failing test (Robolectric, same harness as WebWatcherDestroyTest; full file available on request):
fun `keyboard event does not end a visit in a detected browser`() {
val vivaldi = "com.vivaldi.browser"
val writer = installRecordingWriter()
setField("probeMemory", BrowserProbeMemory(null) {})
setField("detectedBrowsers", mapOf(vivaldi to 1L))
tracker().handleUrl("example.org", vivaldi)
setField("lastWindowId", browserWindow)
activeRoot(vivaldi)
service.onAccessibilityEvent(event(keyboard, keyboardWindow))
assertEquals("A keyboard event must not split a detected browser's visit", 0, writer.submitted)
assertEquals(vivaldi, tracker().currentBrowser)
assertEquals("example.org", tracker().handleUrl(null, null)?.url)
}
Today one visit is written and the session is closed.
Fix direction: in browserIsActiveWindow, treat the active root's package as a browser if it is in KNOWN_BROWSER_PACKAGES or is an active detected browser, using the same predicate as isKnownBrowser.
Priority: medium (split visits for every detected browser while typing). This repo only has a priority: high label, so no priority label is set.
fingerprint: watcher/WebWatcher.kt — browserIsActiveWindow ignores detected browsers; keyboard events split their visits
Confirmed by code read on master 3b820d61, and independently re-checked. The test has not been run (no JDK on my host).
- Dominant language
- Kotlin
- Stars
- 291
- Forks
- 73
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 27
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ActivityWatch/aw-android
-
Widget ignores short hex category colors (#CCC), so Uncategorized gets a fallback colorPossibly taken @TimeToBuildBob claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ActivityWatch/aw-android#433 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ActivityWatch/aw-android#431 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ActivityWatch/aw-android#430 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ActivityWatch/aw-android#383 · 2 comments ·
Maintainers usually reply within 2 days
-
Web watcher: add support for Brave (`com.brave.browser` missing from KNOWN_BROWSER_PACKAGES)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ActivityWatch/aw-android#306 · 1 comment · 2 reactions ·
Maintainers usually reply within 2 days
All issues in ActivityWatch/aw-android
Similar issues
-
Area: Java bug report needs triage OS: Windows
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
actions/runner-images#15458 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nwverse/persona#22164 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
valkey-io/valkey-glide#8000 ·
Maintainers usually reply within 2 days
-
Declare two limitations the 2026-12-02/03 plausibility runs confirmed: Huxleys ticket link, Gretchen flyerPossibly taken A pull request linked to this issue is open or already merged. Openafk-ok area:data-quality importer size:S
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
enorm-labs/event-junkie#5887 ·
Maintainers usually reply within 1 day