Skip to content

fix(C-P1-S4): retry the provision-tenant 402 race (reach /focus this session)#594

Merged
Victor "David" Medina (Victor-David-Medina) merged 1 commit into
mainfrom
claude/c-p1s4-provision-retry
Jun 27, 2026
Merged

fix(C-P1-S4): retry the provision-tenant 402 race (reach /focus this session)#594
Victor "David" Medina (Victor-David-Medina) merged 1 commit into
mainfrom
claude/c-p1s4-provision-retry

Conversation

@Victor-David-Medina

Copy link
Copy Markdown
Collaborator

Customer-evolution Phase 1. A new owner whose Stripe webhook hasn't set plan_tier yet no longer hits a 'workspace still activating' wall they must retry next login.

The 402 is the activation race; the server route is already idempotent, so provisionTenant() now polls 4× with backoff (~10s) instead of giving up on the first 402 — the webhook almost always lands within seconds → ready. Still-pending stays non-blocking (the 'Go to my first brief' banner → sample /focus, self-clears next load).

No send path / billing change; honesty preserved. tsc 0 errors.

…session)

Customer value: a new owner whose Stripe webhook hasn't set plan_tier yet no longer
hits a 'workspace still activating' state they must come back and retry next login —
they reach a fully-ready /focus in the SAME session.

The 402 is the activation race (plan_tier not set yet). The server route is already
idempotent (returns the existing tenant once provisioned), so provisionTenant() now
polls 4x with growing backoff (~10s total) instead of giving up on the first 402. The
webhook almost always lands within seconds → 'ready'. If still pending after the window
it returns 'pending' as before — still NOT a dead-end (the non-blocking 'Go to my first
brief' banner routes to sample /focus, which self-clears on the next load).

No new send path, no billing change, honesty (sample) preserved. tsc: 0 errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🛡️ Cascade Quality Score: 100/100

Category Score Status
TypeScript 20/20
ESLint 20/20
Brand Compliance 15/15
Test Suite 25/25
Build 20/20

Threshold: 85/100 | Result: PASS ✅

@Victor-David-Medina Victor "David" Medina (Victor-David-Medina) merged commit 51f12a8 into main Jun 27, 2026
9 of 10 checks passed
@Victor-David-Medina Victor "David" Medina (Victor-David-Medina) deleted the claude/c-p1s4-provision-retry branch June 27, 2026 19:37
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