fix: honour a transaction response only for a transaction approval (closes #262)
The liveness fix this issue describes — settle 4001 on release when the window a retry would use is gone — already landed with #271. This completes the rest. AUTISTMASK_TX_RESPONSE now refuses any approval that is not a transaction approval, so a reject can no longer retire a sign or connection approval, and a signed artifact never runs the broadcast path against one — which before only failed closed by throwing deeper in. Tests pin the site-connection port's approve, reject and disconnect paths against a transaction approval broadcasting behind them: each is declined and the dApp still receives its broadcast result. Model: opus-4-8
This commit was merged in pull request #391.
This commit is contained in:
@@ -1344,6 +1344,15 @@ runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
const approval = pendingApprovals[msg.id];
|
||||
if (!approval) return false;
|
||||
|
||||
// This message signs and broadcasts a transaction, so it is honoured
|
||||
// only for a transaction approval. A sign or connection approval
|
||||
// carries no approvedTx, and reaching the broadcast path with one used
|
||||
// to fail closed by throwing deeper in; refusing here keeps a future
|
||||
// refactor from turning that incidental throw into a live path, and
|
||||
// keeps a reject on this message from retiring an approval of another
|
||||
// kind.
|
||||
if (approval.type !== "tx") return false;
|
||||
|
||||
// A reject arriving while an attempt holds the approval is refused,
|
||||
// not honoured: the attempt is on its way to broadcasting the
|
||||
// transaction, and resolving 4001 here would tell the page the request
|
||||
|
||||
Reference in New Issue
Block a user