Skip to content

improvement(config): one resolver for projected server switches, plus audit follow-ups - #10430

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/twin-retirement-audit-followups
Nov 26, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/twin-retirement-audit-followups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

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_API and E2B_ENABLED resolve through one resolveServerSwitch (server env on the server, the deployment-shape projection in the browser) instead of five copies of the same branch.
  • deployment-shape: isSameDeploymentShape compares 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).
  • Docs:
    • authentication.mdx: drop the "set both server and NEXT_PUBLIC_ flags" sentence; no pairs are left.
    • integrations-oauth.mdx: the Slack trigger needs two variables, not three; name SLACK_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.
  • Contract TSDoc and a test mock message describe current behavior.

Test plan

  • deployment-shape.dom.test.tsx and deployment-projection.dom.test.ts pass
  • check:client-boundary, check:comment-hygiene, check:docs pass locally
  • CI

… 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.
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 26, 2026 7:24pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · This PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

This PR combines five server-switch readers into resolveServerSwitch and makes the top-level deployment-shape comparison generic.

  • Five server switches share one server-and-browser resolver.
  • Browser deployment shapes notice changes to every top-level field.
  • The billing test message describes Redis as unavailable.

Reviews (1) · Last reviewed commit: "improvement(config): one resolver for pr..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the window check 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

Comment thread apps/sim/lib/core/config/env-flags.ts Resolved
@waleedlatif1
waleedlatif1 merged commit 3b11316 into staging Nov 26, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/twin-retirement-audit-followups branch November 26, 2026 21:31

This branch was successfully deployed

1 active deployment
Preview — 52460083 Deployed Nov 26, 2026 by vercel[bot]
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