Skip to content

fix(web): grant developer credit purchases once - #3557

Open
yashranaway wants to merge 1 commit into
CapSoftware:mainfrom
yashranaway:fix/developer-credit-accounting
Open

yashranaway wants to merge 1 commit into
CapSoftware:mainfrom
yashranaway:fix/developer-credit-accounting

Conversation

@yashranaway

@yashranaway yashranaway commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

developer credit purchases could be granted twice. stripe can deliver the checkout completed and async payment succeeded events for the same purchase at nearly the same time, and the webhook's "already granted?" check ran outside any lock, so both deliveries saw nothing and both added the credits. one $25 top up became $50.

now the credit helper locks the account row and re-checks for that payment inside the same transaction before adding anything, so a second delivery just returns the current balance. no schema change, subscriptions untouched.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the locked payment check closes the duplicate-grant race.

Summary

The PR prevents concurrent Stripe deliveries from granting the same developer credit purchase twice.

  • Developer credit purchases add credits only once per payment.

Reviews (1) · Last reviewed commit: "fix(web): grant developer credit purchas..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 29, 2026 8:46pm UTC

@yashranaway

Copy link
Copy Markdown
Contributor Author

@greptileai review

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 29, 2026 20:46 Inactive

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 37afa543 Deployed Oct 29, 2026 by vercel[bot]
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.

1 participant