From c9e1eb5075094a837dbe22f757126f1ad1adc763 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Wed, 11 Mar 2026 18:31:35 +0100 Subject: [PATCH] fix(servo-shell): guard create_app_webview against duplicate session_id A broadcast LaunchAck can arrive in addition to any direct response, causing create_app_webview to be called twice for the same session. Without the guard the second call silently overwrites the existing WebView entry without destroying it. Early-return if the session is already tracked. --- crates/weft-servo-shell/src/embedder.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/weft-servo-shell/src/embedder.rs b/crates/weft-servo-shell/src/embedder.rs index dcb7b13..0ea5f2f 100644 --- a/crates/weft-servo-shell/src/embedder.rs +++ b/crates/weft-servo-shell/src/embedder.rs @@ -133,6 +133,9 @@ impl App { } fn create_app_webview(&mut self, session_id: u64, app_id: &str) { + if self.app_webviews.contains_key(&session_id) { + return; + } let (Some(servo), Some(rc)) = (&self.servo, &self.rendering_context) else { return; };