Fixes dropped webview telemetry in GlWebviewApp-based webviews#5502
Draft
sergeibbb wants to merge 1 commit into
Draft
Fixes dropped webview telemetry in GlWebviewApp-based webviews#5502sergeibbb wants to merge 1 commit into
sergeibbb wants to merge 1 commit into
Conversation
`GlWebviewApp.connectedCallback` creates the `TelemetryContext` but never registered the window listener that forwards `gl-telemetry-fired` DOM events (from `emitTelemetrySentEvent`) to the host over IPC — that bridge existed only in the legacy `App` base. Every such event from a modern (Lit) webview — graph (including all the graph sidebar panel telemetry from #5356), home, commit details, timeline, settings, welcome, rebase, composer — was silently dropped; only events sent directly through `TelemetryContext.sendEvent` arrived. Found during the live validation sweep for #5477: the webview emitted `graph/branches/branchAction {location:'inline'}` as a DOM event but it never reached the host telemetry service. Verified fixed live — the event now arrives exactly once, and the sidebar `shown`/`action` events flow end-to-end.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GlWebviewApp.connectedCallbackcreates theTelemetryContext(and provides it via context), but never registered thewindowlistener that forwardsgl-telemetry-firedDOM events — the events dispatched byemitTelemetrySentEvent— to the host over IPC. That bridge exists only in the legacyAppbase class. As a result, everyemitTelemetrySentEvent-emitted event from a modern (Lit/RPC) webview was silently dropped; only events sent directly throughTelemetryContext.sendEventarrived.Affected webviews (everything on
GlWebviewApp/GlAppHost/SignalWatcherWebviewApp): Graph — including all of the #5356 sidebar panel telemetry (graph/{panel}/shown,*Action,filtered,layoutToggled, …) and the Visualizations/Kanban/Timeline events — plus Home, Commit Details, Timeline, Settings, Welcome, Rebase, and Composer. OnlypatchDetails(still on legacyApp) was forwarding.Since when: the bridge-less
GlWebviewAppwas introduced 2026-03-16 in the Supertalk RPC infrastructure (2b7c1c708); each webview has been affected from the commit that migrated it onto the new base (e.g. Home inff68fa180, the Lit Graph app in265e3a155). Events instrumented viaemitTelemetrySentEventin those apps have not been reaching analytics since.The fix
Registers the same forwarding listener the legacy
Appclass has —DOM.on(window, telemetryEventName, e => this._telemetry.sendEvent(e.detail))— inGlWebviewApp.connectedCallback, disposed with the app's other disposables. 6 lines, no behavior change beyond restoring the forwarding; no double-send is possible (the legacy class is a separate hierarchy, and directTelemetryContext.sendEventcallers don't dispatch DOM events).How it was found & verified
Discovered during the live validation sweep for #5477: the graph webview emitted
graph/branches/branchAction {location:'inline'}as a DOM event, but a spy on the host telemetry seams received nothing; a source sweep confirmed exactly onetelemetryEventNamelistener in the entire apps tree, in the legacy class. After the fix (verified live in a real instance): the event arrives exactly once, and the sidebar panelshown/actionevents flow end-to-end from DOM emit → IPC →WebviewController.sendTelemetryEvent.Test plan
shownevents arrive on panel switchespnpm run checkclean; webviews build compilesgraph/*,home/*event volumes recover in analytics🤖 Generated with Claude Code