fix(funding): paginate transfer reconcile past the first 100 (dup-payout guard) - #71
Open
keithfawcett wants to merge 1 commit into
Open
fix(funding): paginate transfer reconcile past the first 100 (dup-payout guard)#71keithfawcett wants to merge 1 commit into
keithfawcett wants to merge 1 commit into
Conversation
…out guard) reconcileIntent listed only the first 100 transfers in a batch's transfer_group. A batch with >100 transfers whose match sits on a later page looked "absent", so the intent was reset to pending and RE-POSTED — a duplicate partner transfer. Follow has_more to exhaustion (stop early on match). Isolated, Codex-tagged safe subfix of the funding-race set (#12); the flag stays off. Test: an ambiguous intent whose landed transfer is on page 2 now reconciles (confirmed, no re-POST) and the listing pages twice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| it('reconcile pages past the first 100 transfers to find the match (no duplicate re-POST)', async () => { | ||
| const partnerId = await seedPartner(); | ||
| const commissionIds = await seedCommissions(partnerId, 1, '50.00'); | ||
| const batch = await fundedBatch(partnerId, commissionIds, 5000); |
This was referenced Aug 8, 2026
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.
Problem (audit #12 — one isolated subfix)
reconcileIntent(funding transfer executor) listed only the first 100 transfers in a batch'stransfer_groupto decide whether an ambiguous transfer had actually landed. A batch with >100 transfers whose match sat on a later page looked absent → the intent was reset topendingand re-posted, sending a duplicate partner transfer.Fix
Page through the whole
transfer_groupviahas_more/starting_after, stopping early once ouropenpartner_transfer_intent_idmetadata stamp is found. This is the isolated, Codex-tagged safe subfix of the funding-race cluster (#12);HOSTED_FUNDING_ENABLEDstays off.Tests
New case: an ambiguous intent whose landed transfer is on page 2 now reconciles (
confirmed, no re-POST) and the listing is called twice. All 12 executor tests pass; typecheck clean.Not in this PR
The rest of #12 (ambiguous-PI re-create search, release-vs-create guard, inbox claim-after-process) and #10 (direct-Connect transfer-before-commit restructure) are larger money-state-machine changes — see the notes on the tracking issue; recommended as a focused, staged effort.
🤖 Generated with Claude Code