From 21385abff73f6df735fa1ebf27579e82e24782ca Mon Sep 17 00:00:00 2001 From: Sergei Shmakov Date: Tue, 14 Jul 2026 18:40:30 +0200 Subject: [PATCH] Fixes dropped webview telemetry in GlWebviewApp-based webviews MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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) --- src/webviews/apps/shared/appBase.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/webviews/apps/shared/appBase.ts b/src/webviews/apps/shared/appBase.ts index e6ed1320a01c3..bbf3e7b1bbae5 100644 --- a/src/webviews/apps/shared/appBase.ts +++ b/src/webviews/apps/shared/appBase.ts @@ -141,6 +141,12 @@ export abstract class GlWebviewApp extends GlElement { this._ipc, (this._promos = new PromosContext(this._ipc)), (this._telemetry = new TelemetryContext(this._ipc)), + // Forward `emitTelemetrySentEvent` DOM events to the host over IPC. Without this bridge + // (present in the legacy `App` base below, but previously missing here) every + // `gl-telemetry-fired` event from a `GlWebviewApp`-based webview was silently dropped. + DOM.on(window, telemetryEventName, e => { + this._telemetry.sendEvent(e.detail); + }), ); // Focus tracking (sends debounced focus state to host for context keys)