Repository navigation
Fix the return from checkout landing on the homepage; welcome list after upgrading - #37
Merged
Merged
Conversation
A returning visitor's service worker did not match /editor/?pro=success&session_id=... against the cached editor page and fell back to the homepage. Checkout now returns to /editor/#pro=success, the browser remembers the session id it started, and an unfinished checkout is re-checked when the editor next opens. The service worker ignores query parameters when matching cached pages, which also fixes ?look= and ?ext= links for returning visitors. After upgrading, the account panel lists what Pro brings. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016tciSRcwDsHcLgxbSDvQgC
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
The bug
After paying in Stripe's checkout, a returning visitor landed on the homepage instead of the editor. The service worker matches navigations against its cached pages, and
/editor/?pro=success&session_id=...did not match the cached editor page because of the query string, so it fell back to the homepage. The same thing affected/editor/?look=(Gallery "Use this look") and?ext=links for returning visitors.The fix
/editor/#pro=success(and#pro=cancel); a fragment is ignored when matching cached pagesglint_pro_checkout), so the editor can confirm the payment with the server however the person comes back. A checkout that was never seen to finish is re-checked quietly the next time the editor opens, and dropped after a whileignoreURLParametersMatching), which fixes the?look=and?ext=links tooTesting
npm run checkpasses;testBillingRouteschecks the new return address and that the session id is returned#pro=success, paid but landed without a marker, abandoned checkout, cancelled, payment still pending, and starting a checkout stores the idsw.jscarries the new matching ruleGenerated by Claude Code