Skip to content

fork: command palette test clears a leaked last-used project (upstream #35107) - #11

Merged
scuttletoby merged 1 commit into
mainfrom
fork/fix-palette-leaked-project
Nov 12, 2026
Merged

scuttletoby merged 1 commit into
mainfrom
fork/fix-palette-leaked-project

Conversation

@scuttletoby

@scuttletoby scuttletoby commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Fixes the random Test Web 2 failure CommandPalette.browser.test.tsx > highlights the first project when New thread in... opens from the root list (PR #8 both attempts, PR #4 run 43233261391, PR #6 run 43218151901; 4 of the 11 finished Test Web 2 runs).

Cause (test, not component). Browser test files run one after another in the same browser context and share one origin's localStorage. A file that leaves t3code:last-used-project:v1 pointing at a project that this test does not list hides the default "New thread in " row. "New thread in..." is then the first row, already highlighted, so the test's ArrowDown moves past it to "Go to file" and the data-highlighted wait times out (the 15 s failure in CI). Whether it fails depends on which files the shard runs before it in the same worker, which is why it looked random and never failed when run alone.

Fix. Upstream's own fix, cherry-picked unchanged: pingdotgg/t3code 5fae2b5 (pingdotgg#35107, 2026-11-12), which is newer than the fork's upstream base dc032d7. setup() removes the remembered project before each test. Upstream had the same flake, so this goes away for the fork the next time it follows upstream as well; this PR only gets it sooner.

Repro, locally.

  • Without the fix: the file alone had 0 failures in over 100 runs (idle, under 20× CDP CPU throttling, with the run held 7 s after the key), so load and timing are not the cause. Writing the leaked key in a beforeEach, as an earlier file does: 20/20 fail, with the same assertion as CI.
  • With the fix and the same leaked key injected: 0/50 fail. Unmodified file: 3/3 runs pass.

Lint and format are clean for the file. Known red on fork PRs from fork main (Lint, schema check) is fixed by #8, not here.

General vs project

General: a test fix taken from upstream, nothing specific to this fork.

🤖 Generated with Claude Code

…ngdotgg#35107)

Upstream's own fix, cherry-picked unchanged. Browser test files share one
origin's localStorage, so a last-used project left by an earlier file hides the
"New thread in <project>" row. "New thread in..." then becomes the first row
and ArrowDown moves past it, which fails Test Web 2 on fork PRs whenever such a
file runs before CommandPalette.browser.test.tsx in the same worker.

(cherry picked from commit 5fae2b5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scuttletoby
scuttletoby merged commit 537e3ed into main Nov 12, 2026
2 checks passed
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