fix(env): preserve hosted detection during client recovery - #7445
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThe PR preserves hosted-mode detection during client recovery when runtime configuration is temporarily unavailable, while retaining configured URL precedence and server-side behavior.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified. The fallback is limited to browser initialization without usable runtime configuration, while valid configured URLs continue to take precedence and server behavior remains unchanged.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/core/config/env-flags.ts | Adds browser-hostname fallback for hosted detection while preserving valid configured URL precedence and env-only server behavior. |
| apps/sim/lib/core/config/env.ts | Updates documentation to describe runtime-environment availability during Next.js error-document recovery. |
| apps/sim/lib/core/config/env-flags.dom.test.ts | Covers hosted model and API-key visibility before and after runtime configuration is installed during client recovery. |
| apps/sim/lib/core/config/env-flags.test.ts | Verifies that a configured self-hosted URL overrides the browser hostname in production. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[env-flags module initializes] --> B{Runtime app URL available?}
B -->|Yes and valid| C[Use configured URL hostname]
B -->|No or invalid| D{Browser environment?}
D -->|Yes| E[Use document hostname]
D -->|No| F[Use empty hostname]
C --> G[Compute hosted mode]
E --> G
F --> G
Reviews (1): Last reviewed commit: "fix(env): preserve hosted detection duri..." | Re-trigger Greptile
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.
Summary
Type of Change
Testing
The recovery regression fails before the fix and passes afterward. Passed 70 focused Vitest tests, lint, all 45 repository audits, API validation, the env-flag audit, block-registry checks, and docs-manifest validation.
Checklist