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 intoJun 27, 2026
Conversation
…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>
🛡️ Cascade Quality Score: 100/100
Threshold: 85/100 | Result: PASS ✅ |
51f12a8
into
main
9 of 10 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Customer-evolution Phase 1. A new owner whose Stripe webhook hasn't set
plan_tieryet 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.