Repository navigation
Redeem a proxy connect return once under StrictMode - #1884
Closed
michielbdejong wants to merge 1 commit into
Closed
michielbdejong wants to merge 1 commit into
michielbdejong wants to merge 1 commit into
Conversation
In dev, StrictMode ran ProxyConnectReturn's effect twice. The first run consumed the pending handoff and was cancelled before redirecting; the second found no handoff and showed "This connection return is not one this browser started." Share one redemption per integration_state so the second run awaits the first and redirects. Closes #1883 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
Open
Member
|
Trekmeester: included in batch #1915 (run 36779344325). It lands with it when green; if this PR's own tests fail there, I take it out and say why here. |
Member
joepio
added a commit
that referenced
this pull request
Oct 1, 2026
Member
|
Merged into develop through batch #1947 (squash Generated by Claude Code |
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 free
to 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.
Closes #1883
In a Vite dev build, React StrictMode runs
ProxyConnectReturn's effect twice. The first run consumed the pending handoff and started redeeming, and then its cleanup cancelled the redirect. The second run found no handoff and showed "This connection return is not one this browser started."Fix.
redeemOncekeeps one in-flight redemption perintegration_statein a module-level map. The second effect run awaits the first run's promise and redirects when it resolves. A settled entry stays for 10 s, so a remount right after it resolves still gets the result, and is then dropped. A return this browser never started still errors, and a failed redemption is attempted and shown once. Production builds were not affected.Test.
ProxyConnectReturn.test.tsxrenders the component inside<React.StrictMode>, withProxyConnectionsmocked andlocationstubbed. It checks four things:Before the fix, the first two tests failed:
replacewas never called, andfinishwas called twice.Checked: the
chunks/AppPageandproxyConnectionsvitest suites,typecheckandlintall pass. No UI change, so no screenshots.Pin candidate.
ProxyConnectReturn.tsxalso exists onclaude/atomic-plugins-pin-candidate14, where the effect callsfinishProxyReturn(store, connections, params)(it returnsreturnTo) instead ofconnections.finish(params). This commit does not apply cleanly there:git merge-treereports a content conflict in the effect. The resolution is mechanical. KeepredeemOnceand, inside it, callfinishProxyReturn(store, connections, params)in place ofconnections.finish(params).then(({ returnTo }) => returnTo). The new test works unchanged there, because its mockedfinishresult carries norecordOnInstallation. The fix should go into the next pin candidate.🤖 Generated with Claude Code