Skip to content

Fixes dropped webview telemetry in GlWebviewApp-based webviews#5502

Draft
sergeibbb wants to merge 1 commit into
mainfrom
bug/5477-webview-telemetry-bridge
Draft

Fixes dropped webview telemetry in GlWebviewApp-based webviews#5502
sergeibbb wants to merge 1 commit into
mainfrom
bug/5477-webview-telemetry-bridge

Conversation

@sergeibbb

Copy link
Copy Markdown
Member

Summary

GlWebviewApp.connectedCallback creates the TelemetryContext (and provides it via context), but never registered the window listener that forwards gl-telemetry-fired DOM events — the events dispatched by emitTelemetrySentEvent — to the host over IPC. That bridge exists only in the legacy App base class. As a result, every emitTelemetrySentEvent-emitted event from a modern (Lit/RPC) webview was silently dropped; only events sent directly through TelemetryContext.sendEvent arrived.

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. Only patchDetails (still on legacy App) was forwarding.

Since when: the bridge-less GlWebviewApp was 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 in ff68fa180, the Lit Graph app in 265e3a155). Events instrumented via emitTelemetrySentEvent in those apps have not been reaching analytics since.

The fix

Registers the same forwarding listener the legacy App class has — DOM.on(window, telemetryEventName, e => this._telemetry.sendEvent(e.detail)) — in GlWebviewApp.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 direct TelemetryContext.sendEvent callers 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 one telemetryEventName listener 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 panel shown/action events flow end-to-end from DOM emit → IPC → WebviewController.sendTelemetryEvent.

Test plan

  • Live-verified: graph sidebar inline action → exactly one event at the host telemetry service; panel shown events arrive on panel switches
  • pnpm run check clean; webviews build compiles
  • Post-merge: confirm graph/*, home/* event volumes recover in analytics

🤖 Generated with Claude Code

`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.
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