Repository navigation
Preserve newer Stripe withdrawal state during submission - #957
Closed
Gajesh2007 wants to merge 2 commits into
Closed
Gajesh2007 wants to merge 2 commits into
Gajesh2007 wants to merge 2 commits into
Conversation
Gajesh2007
had a problem deploying
to
benchmarks
September 12, 2026 01:02 — with
GitHub Actions
Failure
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Gajesh2007
marked this pull request as ready for review
September 12, 2026 01:04
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Gajesh2007
added a commit
that referenced
this pull request
Sep 16, 2026
Member
Author
|
Consolidated into #1056 for review and merge after #1094, #1095 and #1096. #1056 contains this branch's exact head ( |
This branch had an error being 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.
A Stripe webhook can mark a withdrawal paid or refunded while its submission handler is waiting for
payouts.create. The handler then writes its older transferred row, erasing the sweep ID, refund flags and terminal status. The new regression exercises the actual submission handler and a concurrent paid/reversal transition; both cases fail on master.Submission now retains its last acknowledged mutable state and updates through
CompareAndSwapStripeWithdrawal. Memory performs the comparison and index changes under one lock; PostgreSQL uses one conditional UPDATE. An exact desired state is successful retry after a lost database acknowledgement. A different current state is preserved, the handler stops subsequent submission steps, and the client receives 409withdrawal_state_changedwith instructions to check history. Immutable account, amount, method and creation fields stay unchanged.The two legacy already-refunded status-only webhook updates use their lookup snapshot with the same comparison. Sweep-bounce and reversal transitions are addressed separately by #933 and #925; after those changes are composed, production no longer calls the unconditional legacy setter. This does not make Stripe calls and database transactions atomic or reconcile a previously unknown payout ID.
Before:
After:
Validation:
GOTOOLCHAIN=go1.25.0 go test ./coordinator/...passes (API 193.782s).