Uh oh!
There was an error while loading. Please reload this page.
fix(app-shell): New chat — URL mirror bounced on in-SPA ?new=1 navigation (stale-closure race) - #1647
Merged
Merged
Conversation
…w=1 navigation The #1638 fix worked on a full page load but not on the actual button: an in-SPA navigate('/ai?new=1') fires the URL-mirroring effect in the SAME commit as the conversation hook's effect, with the stale conversationId still in its render closure — it bounced back to /ai/:oldId and stripped the flag before the fresh conversation existed. Guard: snapshot the id visible when the flag appears (render-phase ref write, so it precedes every effect of that commit) and refuse to mirror that exact id while ?new=1 is up. The fresh id differs, mirrors normally, and the navigation strips the flag, resetting the snapshot. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User-reproduced on staging: clicking New in the chat sidebar bounced straight back to the previous conversation (
/_console/ai/conv_…). #1638's fix held for full page loads (state starts empty) but not the button's in-SPA navigation: at the/ai?new=1commit, the URL-mirroring effect still holds the staleconversationIdin its render closure — the hook'ssetConversationId(undefined)hasn't re-rendered yet — so it rewrote/ai/:oldIdand stripped the flag before the fresh conversation existed.Fix: snapshot the id visible at the moment the flag appears (a render-phase ref write — set before any effect of that commit runs) and refuse to mirror that exact id while
?new=1is up. The fresh id differs → mirrors normally → navigation strips the flag → snapshot resets. Covers repeat-New and direct-URL cases.app-shell suite 409/409, build green. Will verify on staging with the user's exact repro after the pin bump.
🤖 Generated with Claude Code