Chat

Instant clarity across your entire codebase
Ask architectural questions and trace execution paths with zero context limits.

Blame Chat 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.

Every workflow. Every surface.
One intelligence layer embedded everywhere your engineering happens.

GitHub discussions & pull requests

Deep architectural reasoning and codebase questions answered directly in issues and PR discussions.

IA
iliasabs10 minutes ago

@blame why does the session refresh fail during concurrent requests?

B
blamebotjust now

In auth/session.ts, token rotation revokes the previous refresh token immediately with zero grace period. Parallel requests using the in-flight token fail validation before receiving the newly issued session.

Slack channels & incident threads

Summon Blame in channels or incident threads for instant root cause diagnosis and multi-service traces.

#deploy-alerts
Logan Veny
Logan Veny14:22

Stripe webhook retries are dropping idempotency keys. @Blame can you trace the root cause?

BlameAPP14:22

Traced in services/billing/retry.ts. In handleRetry(), the retry wrapper re-serializes payload buffers without preserving incoming transport headers, dropping the Idempotency-Key before dispatch.

From issue to merged PR
Autonomous resolution pipeline grounded in deterministic repository context.

Blame pipeline background

Traces cross-file execution paths in milliseconds.

Why does the payment block fail on webhook timeout retries?
  • Searching...
Blame pipeline background

Grounds logic in workspace architecture rules.

Blame pipeline background

Pushes verified fixes compliant with repo guidelines.

Questions & Answers

Experience codebase clarity without tab-switching