Skip to content

fix(bounties): reserve claims before payout - #48

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/atomic-bounty-claim-payout
Aug 10, 2026
Merged

fix(bounties): reserve claims before payout#48
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/atomic-bounty-claim-payout

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Closes #47

Summary

  • reserve a funded bounty with UPDATE ... RETURNING
  • stop immediately when the conditional update returns no row
  • remove the follow-up claimant read that allowed same-DID concurrent requests to continue
  • add a focused regression that keeps the atomic reservation before CoinPay payout preparation

Why

Two requests from the same DID could both pass the initial funded-state read. Only one update succeeded, but both later reads saw that DID as the claimant and both could prepare and broadcast a payout.

Validation

  • node --test test/*.test.mjs (4/4)
  • tsc -p apps/web/tsconfig.json --noEmit
  • git diff --check

The local Next 16.2.7 route-handler guide was reviewed before finalizing the route change.

@ralyodio
ralyodio merged commit 53d55bf into profullstack:master Aug 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concurrent claims by the same user can trigger duplicate bounty payouts

2 participants