Repository navigation
Close the webhook-first, contact and poll-ownership gaps #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alecritson
merged 5 commits into
main
from
edw2-205-checkout-package-gate-webhook-first-placement-on-a-pinned
Oct 19, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f654ad0
fix(checkout): close the webhook-first, contact and poll-ownership gaps
alecritson 8a44478
fix(checkout): review follow-ups on webhook-first adoption
alecritson c646825
fix(checkout): keep the webhook-first flag on MySQL; freeze pinned in…
alecritson 99b8225
fix(checkout): address review on #3
alecritson 3b1ad7b
docs(checkout): clarify the race helper and when the intent grant starts
alecritson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Webhook-first customers never get the pinned-session ownership grant
Medium · Full review
rememberPinnedSession()is only called frompay(). In the webhook-first flow this PR adds, the customer confirms with Stripe.js and never callspay(), so their browser session never gets the UUID.If the webhook arrives before the Stripe.js
return_urlredirect or the first processing poll, the listener completes the session andCartSession::current()mints a fresh cart.ensureOwnership()then falls through to the cart check and returns 403. That is the same race the PR fixes for thepay()path, and the PR description lists "no confirmation handover" as one of the symptoms being fixed.Fix: also call
rememberPinnedSession($session)instorePaymentIntent()after the intent is created, since the browser holding the intent is the one that can confirm it. Add a test where the listener completes an Open session and the same browser then pollsprocessing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed in 99b8225.
storePaymentIntentnow records the grant once the intent is created, since that browser can confirm with the gateway directly. New test:lets the browser that created the intent reach the confirmation after a webhook-first completion. It creates an intent through the route, has the gateway place the order, checks the listener completes the session, and then the same browser's poll redirects to success with the handover. It fails without the change.