Repository navigation
Fix red main: read hosted tenant delete token lazily from process.env - #9669
Merged
Merged
Conversation
0eecd5a (#9607) switched SUBROUTER_STACK_TENANT_DELETE_TOKEN to the validated env object, but t3-env freezes values at first import, so tenant-control configuration became unobservable after boot and the unconfigured paths broke: the exchange route returns 200 instead of 503 and account deletion fires hosted tenant deletes for accounts that never enabled Subrouter. web tests have been red on main since (CI paused). env.ts still validates presence on Vercel non-preview deployments. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe hosted client now resolves ChangesTenant delete-token configuration
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Main has been red on web tests since 0eecd5a (#9607, "Read hosted credentials through validated runtime env"): 2 failures in
web/tests/account-route.test.tsand 1 inweb/tests/hosted-subrouter-routes.test.ts. CI is paused, so it landed unnoticed; it currently blocks the merge gate for #9319 (and any other PR gated onweb-typecheck).Mechanism: t3-env's
envobject freezes values at first import.SUBROUTER_STACK_TENANT_DELETE_TOKENgates hosted tenant control per client construction, and the tests toggle it per-case viaprocess.env, so the frozen read makes the client permanently "configured": the exchange route returns 200 instead of 503 when unconfigured, and account deletion fires hosted tenant deletes for accounts that never enabled Subrouter.Fix restores the lazy
process.envread (parent-commit behavior) with a comment stating the constraint. Deploy-time validation is unchanged:env.tsstill requires the value on Vercel non-preview.Verified on this branch:
tests/hosted-subrouter-routes.test.ts18/18,tests/account-route.test.ts65/65,bun run typecheckclean. Both files fail identically onorigin/main, pass at0eecd5afea~1.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Read the hosted tenant delete token lazily from
process.envto avoidt3-envfreezing the value at import time. This restores per-client configuration, returns 503 when unconfigured, and prevents unintended hosted tenant deletes.SUBROUTER_STACK_TENANT_DELETE_TOKENviaprocess.envinstead of the validatedenvobject fromt3-env.env.tsfor Vercel non-preview deployments.Written for commit f2c2b6f. Summary will update on new commits.
Summary by CodeRabbit