fix(browser): land PR #24142 flush relay pending timers on stop

Flush pending extension request timers/rejections during relay shutdown and document in changelog.
Landed from contributor @kevinWangSheng (PR #24142).

Co-authored-by: Shawn <118158941+kevinWangSheng@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-02-26 14:20:43 +00:00
parent 42cf32c386
commit ce833cd6de
2 changed files with 6 additions and 0 deletions

View File

@@ -820,6 +820,11 @@ export async function ensureChromeExtensionRelayServer(opts: {
extensionConnected,
stop: async () => {
relayRuntimeByPort.delete(port);
for (const [, pending] of pendingExtension) {
clearTimeout(pending.timer);
pending.reject(new Error("server stopping"));
}
pendingExtension.clear();
try {
extensionWs?.close(1001, "server stopping");
} catch {