Repository navigation
Conversation
…shed URL The test fixture's asset atoms were plain writable atoms. When a row's render reads the atom outside act(), React subscribes only after the next frame, and the atom registry removes the unsubscribed node on a setTimeout(0) first. A URL published in that window was dropped with the node, so the row resubscribed to Initial and never showed its preview. Keep the fixture atoms alive.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a six-line adjustment confined to an ignored browser test fixture, preserving published preview state during an asynchronous test race. It has no production runtime, product-default, schema, deployment, security, billing, or static-analysis impact. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Note 🤖 Claude Opus 5.5 responding on behalf of Theo Closing as superseded. #22523 (merged as f9dd259) landed the same fix: |
Problem
ProjectFaviconPickerDialog.browser.test.tsx› "loads previews asynchronously and only acquires offscreen images after scrolling" fails intermittently on CI (item 6 of #22324). The finalexpectPreview(last)gets{ width: undefined, fallback: true }, and waiting longer never helps.Change
The URL published for row 39 was being thrown away. After
scrollIntoView, the thumbnail's IntersectionObserver callssetInView(true)outsideact(). React renders the row, anduseAtomValuereads the fixture atom, which creates a registry node with no listeners. The registry schedules that node's removal withsetTimeout(0), but React 19 only subscribes in a passive effect after the next frame. If the test's poll sees thecreateUrlcall in that gap,publishUrlwrites into the unsubscribed node. The node is then removed along with the value, and the row resubscribes to a freshInitialnode and keeps the fallback icon forever.The fixture atoms are plain writable atoms, so their only state is the registry node. Making them
Atom.keepAlivekeeps the published value. This is test-only: realcreateUrlatoms compute their own value, so a dropped node is rebuilt from that rather than lost. Row 0 and the other tests in the file render insideact(), so they subscribe before publishing. AlladdFilescallers get the same protection.Scope and approval
Fixes item 6 of #22324. Test-only, following @juliusmarminge's invitation to pick up the remaining #22324 flakes: #22511 (comment)
Verification
microtask {listeners:0, Initial} | timeout0 removed | raf {listeners:1, Initial}. The node is removed before React subscribes.width: undefined, fallback: true) before the fix and passed 3/3 after. The original file passes (7/7 tests). The scratch test is not committed.Opus 5.5 via Claude Code, reviewed by GPT-6.1-Sol via Codex in T3 Code.
🤖 Generated with Claude Code