Skip to content

fix(test): repair three browse test files stranded by the v1.63–v1.64.1 refactors - #2590

Closed
sneakygriff wants to merge 2 commits into
garrytan:mainfrom
sneakygriff:fix/browse-tests-stranded
Closed

sneakygriff wants to merge 2 commits into
garrytan:mainfrom
sneakygriff:fix/browse-tests-stranded

Conversation

@sneakygriff

Copy link
Copy Markdown
Contributor

Problem

Three browse test files fail deterministically on pristine c118e240 on any machine that actually runs them (24 failures total):

  1. compare-board.test.ts (16 fails): the v1.64 signature-bridge wrapper for handleReadCommand drops its 4th argument, so the now-unconditional JS-origin assertion TypeErrors on bm.hasCookieImports(). The sibling write bridge two lines down passes it correctly.
  2. extension-sender-auth.test.ts (2 fails): the behavioral "gate answers" loops iterate sidebar-command, which background.js no longer routes (dropped from ALLOWED_TYPES with the chat rip) — the listener goes silent on unknown types before the sender gate ever runs.
  3. security-sidepanel-dom.test.ts (6 fails): five tests drive the shield/banner off the ripped chat path; sidepanel.js now deliberately leaves the shield "hidden by default, not driven". The first test waits 15s for a data-status that never arrives, and bun's timeout handler SIGTERMs the shared beforeAll browser (exit 143), cascading "browser has been closed" into every later test.

CI never sees #3 because the file self-skips wherever Playwright chromium isn't installed.

Fix

  • compare-board: forward b through the read bridge (one argument).
  • sender-auth: behavioral loops iterate routed types; sidebar-command keeps a nothing-usable-leaks check and stays in the sender-auth policy as defense-in-depth.
  • sidepanel: replaced the five stranded tests with pins of the current contract (shield exists, stays hidden, stays undriven) plus a tombstone documenting what was removed, why it can never pass, and how to resurrect the old cases if the shield is ever re-driven.

Verification

bun test browse/test/security-sidepanel-dom.test.ts browse/test/extension-sender-auth.test.ts browse/test/compare-board.test.ts --timeout 30000: 38/38 pass (Playwright chromium-backed, macOS arm64).

🤖 Generated with Claude Code

…efactors

All three failed deterministically on PRISTINE v1.64.1.0 (c118e24) on any
machine that actually runs them; upstream CI never sees the first because
it skips without Playwright chromium installed.

- compare-board.test.ts: the v1.64 signature-bridge wrapper for
  handleReadCommand dropped its 4th argument (the BrowserManager), so the
  now-unconditional JS-origin assertion TypeError'd on bm.hasCookieImports()
  — all 16 tests. The sibling write bridge two lines down had it right.
- extension-sender-auth.test.ts: the behavioral 'gate answers' loops
  iterated 'sidebar-command', which background.js no longer routes (dropped
  from ALLOWED_TYPES with the chat rip) — the listener goes silent on
  unknown types BEFORE the sender gate. Routed types keep the answers
  assertion; 'sidebar-command' keeps a nothing-usable-leaks check.
- security-sidepanel-dom.test.ts: five tests drove the shield/banner off
  the ripped chat path; the first waited 15s for a data-status that never
  arrives, and bun's timeout handler SIGTERM'd the SHARED beforeAll browser
  (exit 143), cascading 'browser has been closed' into the rest. Replaced
  with pins of the current contract (shield exists, stays hidden, stays
  undriven) plus a tombstone for resurrecting the old cases if the shield
  is ever re-driven.

Co-Authored-By: Claude Fable 5 <[email protected]>
@trunk-io

trunk-io Bot commented Aug 15, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

…handleReadCommand bridge (same class as compare-board)

Upstream v1.64.1.0 changed handleReadCommand's signature to (command, args, session, bm), but this file's local bridge still called it with the old 3-arg shape, leaving bm undefined. read-commands.ts:186's now-unconditional JS-origin assertion then TypeErrors on bm.hasCookieImports(), which is exactly the bug already fixed in compare-board.test.ts (8a37d90).

Co-Authored-By: Claude Fable 5 <[email protected]>
@garrytan

Copy link
Copy Markdown
Owner

Closing as superseded: all three target files were repaired or deleted on main before this PR (v1.67.0.0 close-only reclassification; survivors run green at HEAD). Thank you for the report/patch — the class is covered on main.

@garrytan garrytan closed this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants