AI code review for your pull requests
Catch bugs and ship with confidence on every merge.

Blame hero background
Blame Chat
Fix Stripe webhook retry race condition

Why are duplicate subscription invoices generating when Stripe webhooks retry on 504 timeouts?

Verify the idempotency lock in the invoice creation pipeline before updating status.

Traced billing pipeline across 4 repositories and Stripe webhook handlers
Acquired distributed Mutex and enforced idempotency table +3 -1
Blame 10:42 AM

Found the root cause. When Stripe retries after an upstream gateway timeout, concurrent workers processed the same invoice.payment_succeeded event before the database row locked.

I added a distributed Mutex on event_id and wrapped the state transition in an atomic transaction scope. All webhook retry tests now pass.

fix(billing): acquire Mutex lock on Stripe webhook retries

acme/billing-service #1842 +3 -1

I've opened the pull request above with unit tests and rollback protections attached. Let me know if you'd like me to trigger staging deployment or run additional checks.

acme/billing-service #1842
fix(billing): acquire Mutex lock on Stripe webhook retries
acme/billing-service #1842•+3-1
B
blame-appbotreviewed 10:42 AM
src/webhooks/stripe-handler.ts
+3-1
85export async function handleInvoicePayment(event: Stripe.Event) {
86- return await processInvoice(event.data.object as Stripe.Invoice);
86+ await using lock = await mutex.acquire(`stripe:event:${event.id}`);
87+ if (await isEventHandled(event.id)) return;
88+ return await processInvoice(event.data.object as Stripe.Invoice);
89}

Race condition resolved: Mutex lock on Stripe webhook retries

Found the root cause. When Stripe retries after an upstream gateway timeout, concurrent workers processed the same invoice.payment_succeeded event before the database row locked.

I added a distributed Mutex on event_id and wrapped the state transition in an atomic transaction scope. All webhook retry tests now pass.

IA
iliasjust now

LGTM! Unit tests and rollback protections attached. Let's trigger staging deployment.

Why traditional AI code review fails
Diffs show what changed. Blame proves what broke.

Raw git diff inspection

Standard AI review bots only check isolated diff snippets, missing cross-file contract breaks.

Fix retry timeout on webhook dispatch #142

+18-4
Openiliasabs wants to merge 2 commits intomainfromfix/webhook-retry-timeout
Some checks haven’t completed yet
1 in progress
generic-botbotreviewed just now

Looks clean! Syntax checks pass and the modified diff has no obvious style issues.

IA
iliasabsjust now

Merged, but prod crashed: 3 downstream queue workers broke on the unhandled timeout error.

Whole-codebase context

Blame traces code dependencies across your entire codebase to catch breaking changes before merge.

Fix retry timeout on webhook dispatch #142

+18-4
Openiliasabs wants to merge 2 commits intomainfromfix/webhook-retry-timeout
Blame Review in progress...
1 in progress
B
blamebotreviewed just now

Caught breaking contract: jobs/worker.ts:42 called dispatch() without handling the newly thrown TimeoutError.

IA
iliasabsjust now

Patched jobs/worker.ts before merge — prevented prod outage!

How Blame works
across your development cycle.

From repository context to verified fixes, Blame keeps your development cycle moving.

Blame lifecycle background
01 · Repository Context

Always-on codebase context

Blame lifecycle background
02 · Pull Requests

Review every pull request instantly

Blame lifecycle background
03 · Confidence & Safety

Verify the fix before merge

Blame lifecycle background
04 · Autonomous Reasoning

Debug in plain English

Review code with complete repository context

When enabled, Blame runs in the background on every pull request, catching subtle logic flaws, enforcing team conventions, and reasoning across your whole codebase before merge.

Ship with confidence

Blame automatically runs deep AST and semantic code reviews in the background on new pull requests.

PR #1428Fix session token validation & Redis expiry
alex-dev • 3m ago
Checks (3/3 successful)Blame Review: 1 note flagged
src/auth/validateToken.ts+3 -1

14 | const payload = decodeToken(tokenString);

15 | - if (payload.exp < Date.now()) {

16 | + const nowSeconds = Math.floor(Date.now() / 1000);

17 | + if (payload.exp < nowSeconds) {

18 | return { valid: true, user: payload.sub };

Blame BotUnit mismatch

Fixed unit mismatch: token exp claim is in seconds, whereas Date.now() returns milliseconds.

alex-dev: Nice catch, merging!
Ready to mergeSquash and merge

Review analytics

Live distribution of code risks and findings detected by Blame across your repositories.

Review findings
Security:2
Bugs:4
Performance:2

Adapts to your standards

Blame improves as you define and iterate on custom rules, automatically discovering project instruction files.

.cursorrulessrc/components/**

Enforce strict error boundary handling on all client components

Active
AGENTS.mdbackend/services/**

All database mutations must use parameterized transactions

Active
CLAUDE.mdapp/api/**

Zero 'any' types, strict null checks on all API endpoints

Active

High signal, low noise

Blame optimizes for bugs that get fixed. Over 70% of flags are resolved before merge, without shallow linter spam.

Deterministic AST parsingZero hallucinations
Noise suppression pipelineGenerated code skipped
Actionable inline patchesContext-tested diffs

Questions & Answers