D2: bound the navigation guard's tab reset (commit, 5 s)

Ubicloud run 3: a click to a link-local link reported the block, but the
reset's page.goto('about:blank') waited the full 30 s default navigation
timeout, so the command hung past the test deadline and the stale block
leaked into the next command. The reset now waits for commit only, with a
5 s bound.
This commit is contained in:
garrytan committed 2026-10-03 23:17:19 +00:00
1 parent 554d84aecb
commit 6a2c1e57ef
1 file changed
+2 -1
+2 -1
View File
@@ -2106,7 +2106,8 @@ export class BrowserManager {
if (!reason || page.isClosed()) return;
guard.blocked = reason;
console.warn(`[browse] ${reason} (navigation from ${req.frame().url() || 'a new page'}; tab reset to about:blank)`);
await page.goto('about:blank').catch(() => {});
// Commit is enough to blank the tab; a bounded reset never holds the command for the full navigation timeout.
await page.goto('about:blank', { waitUntil: 'commit', timeout: 5_000 }).catch(() => {});
}).finally(() => { guard.pending.delete(check); });
guard.pending.add(check);
});