Author SHA1 Message Date
sneak b3d63ed492 docs: say what settles a tx or sign approval on a port disconnect (closes #505)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
The approval port's disconnect handler leaves a transaction or signing
approval pending, and its comments said that was so the user could reopen
the toolbar popup. Those approvals open in their own window, and the
windows.onRemoved listener settles them when that window closes. Both
comments now say so. No code changed.

Model: opus-5-5
2026-10-14 02:10:52 +00:00
+3 -3
View File
@@ -632,8 +632,8 @@ function isExtensionSender(sender) {
// had refused.
//
// TX and sign approvals do not decide here. They stay pending across a
// disconnect — the user can reopen the toolbar popup — and are rejected by the
// windows.onRemoved listener below.
// disconnect, and the windows.onRemoved listener below settles them when their
// window closes.
runtime.onConnect.addListener((port) => {
if (port.name.startsWith("approval:")) {
const id = port.name.split(":")[1];
@@ -661,7 +661,7 @@ runtime.onConnect.addListener((port) => {
const approval = pendingApprovals[id];
if (approval) {
if (approval.type === "tx" || approval.type === "sign") {
// Keep pending — user can reopen the toolbar popup
// windows.onRemoved settles it when its window closes.
return;
}
settleApproval(id, { approved: false, remember: false });