Skip to content

Fixes dropped webview telemetry in GlWebviewApp-based webviews#5502

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

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

@sergeibbb sergeibbb force-pushed the bug/5477-webview-telemetry-bridge branch from 98ae27a to 45a2b75 Compare July 16, 2026 18:10
`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.

(#5456,#5502)
@sergeibbb sergeibbb force-pushed the bug/5477-webview-telemetry-bridge branch from 45a2b75 to 21385ab Compare July 16, 2026 18:13
@sergeibbb sergeibbb marked this pull request as ready for review July 16, 2026 18:26
@sergeibbb sergeibbb requested a review from a team July 16, 2026 18:26
@augmentcode

augmentcode Bot commented Jul 16, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Restores forwarding of gl-telemetry-fired DOM events in GlWebviewApp-based webviews by registering the same window listener used by the legacy App base.

Impact: Telemetry emitted via emitTelemetrySentEvent from modern Lit/RPC webviews now reliably reaches the host over IPC.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

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