Skip to content

Fix cursor leaks and restore Chrome Timeline tracking - #614

Merged
kasnder merged 4 commits into
masterfrom
agent/fix-traffic-log-cursor-leak
Jul 11, 2026
Merged

Fix cursor leaks and restore Chrome Timeline tracking#614
kasnder merged 4 commits into
masterfrom
agent/fix-traffic-log-cursor-leak

Conversation

@kasnder

@kasnder kasnder commented Jul 11, 2026

Copy link
Copy Markdown
Member

What changed

  • close Traffic Log, DNS, and Forwarding cursors when their activities are destroyed
  • replace Forwarding cursors instead of replacing whole adapters
  • align VPN logging with the Apps tab's predefined system-app classification, so Chrome tracker contacts reach Timeline
  • parse predefined.xml once and share the cached configuration
  • make native-library loading Robolectric-safe without silently terminating test workers
  • add JVM and Robolectric regressions for system classification and cursor disposal

Root causes

CursorAdapter instances retained their final cursors after activity destruction. Separately, the Apps tab treated Chrome as a user-managed app via predefined.xml, while the VPN logger used Chrome's raw Android system-app flag and silently skipped Timeline aggregation. Robolectric workers were also terminated by System.exit(1) when the Android native library was unavailable on the host JVM.

User impact

Chrome traffic now appears in Timeline consistently with the Apps tab, cursor resources are released deterministically, and Robolectric failures are reported normally instead of killing the Gradle worker.

Validation

  • focused JVM/Robolectric classification and cursor-disposal tests
  • :app:assembleGithubDebug
  • Android 17 emulator with active TrackerControl VPN
  • verified Chrome TCP, UDP/QUIC, and IPv6 traffic in the raw Traffic Log
  • verified www.google-analytics.com recorded as blocked and Chrome displayed in Timeline
  • no TrackerControl StrictMode cursor-leak warning or app crash during the verification pass

@kasnder
kasnder marked this pull request as ready for review July 11, 2026 02:01
@kasnder
kasnder merged commit a992949 into master Jul 11, 2026
1 check passed
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