Repository navigation
improvement(config): one resolver for projected server switches, plus audit follow-ups - #10430
Merged
Merged
Conversation
… audit follow-ups - env-flags: the five server-only switches share resolveServerSwitch instead of five copies of the server/projection branch. - deployment-shape: isSameDeploymentShape compares every top-level field, so a new shape field cannot be missed and its reseed silently dropped; covered by a test that flips each switch. - Docs: drop the stale NEXT_PUBLIC pairs sentence in authentication, fix the Slack trigger variable count and wording, and point the upgrade note at the right reference. - Contract comment and a test mock message describe current behavior.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] This PR appears safe to merge. SummaryThis PR combines five server-switch readers into
Reviews (1) · Last reviewed commit: "improvement(config): one resolver for pr..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
1 issue found across 10 files
Confidence score: 2/5
- In
apps/sim/lib/core/config/env-flags.ts, reading a server-only env key before thewindowcheck can throw during browser module initialization and prevent pages from loading. Guard the env access before evaluating those keys.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/core/config/env-flags.ts">
<violation number="1" location="apps/sim/lib/core/config/env-flags.ts:140">
P1: These arguments access `env.<server-only key>` before `resolveServerSwitch` can test `window`. Client access to a server-only `@t3-oss/env-nextjs` key throws during module initialization, so browser pages fail before reading the projected switch; pass a lazy getter and update all five calls so the browser never evaluates `env.<key>`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
This branch was successfully deployed
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.
Follow-ups from the pre-release audit of #10303, #10331, #10342, #10357 and #10359. No behavior change.
Summary
env-flags:BILLING_ENABLED,SLACK_EXTENDED_SCOPES,DISABLE_INVITATIONS,DISABLE_PUBLIC_APIandE2B_ENABLEDresolve through oneresolveServerSwitch(server env on the server, the deployment-shape projection in the browser) instead of five copies of the same branch.deployment-shape:isSameDeploymentShapecompares every top-level field generically instead of a hand-written list, so a future shape field can't be forgotten and its reseed silently dropped. New test flips each top-level switch and asserts the reseed lands, and that an equal shape keeps the current seed (fails with a partial comparison, passes on old and new code).authentication.mdx: drop the "set both server andNEXT_PUBLIC_flags" sentence; no pairs are left.integrations-oauth.mdx: the Slack trigger needs two variables, not three; nameSLACK_EXTENDED_SCOPES.slack.mdx/generate-docs.ts: "Enable it" (one flag now).upgrades.mdx: tell operators to set the same-named server variable; the feature flag reference only lists the enterprise flags.Test plan
deployment-shape.dom.test.tsxanddeployment-projection.dom.test.tspasscheck:client-boundary,check:comment-hygiene,check:docspass locally