Skip to content

fix(upgrade): client side env var check#5673

Merged
icecrasher321 merged 3 commits into
stagingfrom
staging-v1
Jul 14, 2026
Merged

fix(upgrade): client side env var check#5673
icecrasher321 merged 3 commits into
stagingfrom
staging-v1

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Server side env var being used on client for isBillingEnabled. Distinguish correctly. There were two flags called isBillingEnabled and the import was changed in #5545 causing this.

Fix other misc. self hosted plane visibility checks.

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 14, 2026 3:31pm

Request Review

@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Client/server feature gating (billing, orgs, access control) and settings navigation now depend on correct NEXT_PUBLIC_* pairing; misconfiguration could hide or expose the wrong UI surfaces.

Overview
Fixes client bundles treating server-only flags as always off by resolving isBillingEnabled, isAccessControlEnabled, and isOrganizationsEnabled from NEXT_PUBLIC_* twins in the browser (SSR still uses the private env vars), with docs that both must be set together.

Tightens self-hosted / hosted settings visibility: account copilot is hidden and deep links redirect when not hosted; the workspace settings sidebar hides organization-plane items for viewers who are not org admins (via registry-derived ORGANIZATION_PLANE_UNIFIED_SECTIONS). Block editor API key requirements for Ollama models now use isOllamaAvailable(), which falls back to the providers store when OLLAMA_URL is not visible client-side.

Reviewed by Cursor Bugbot for commit 2c20b79. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes client-side handling for billing and self-hosted settings visibility. The main changes are:

  • Browser reads for public billing, organization, and access-control flags.
  • Self-hosted hiding for account copilot settings.
  • Workspace sidebar filtering for organization-plane settings.
  • Ollama model key visibility based on provider-store state.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/lib/core/config/env-flags.ts Updates client and server env flag reads for billing, access control, and organizations.
apps/sim/app/account/settings/[section]/page.tsx Redirects self-hosted account copilot settings to the general account settings page.
apps/sim/components/settings/standalone-settings-shell.tsx Filters copilot from the account settings sidebar on self-hosted deployments.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-sidebar/settings-sidebar.tsx Hides organization-plane self-hosted sidebar links from non-admin viewers.
apps/sim/components/settings/navigation.ts Adds a registry-derived set of unified sections that route through organization settings.
apps/sim/blocks/utils.ts Uses provider-store state as a browser-side signal for Ollama model availability.

Reviews (2): Last reviewed commit: "add tests" | Re-trigger Greptile

Comment thread apps/sim/lib/core/config/env-flags.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2c20b79. Configure here.

@icecrasher321 icecrasher321 merged commit db2fb3c into staging Jul 14, 2026
14 checks passed
@icecrasher321 icecrasher321 deleted the staging-v1 branch July 14, 2026 15:38
@icecrasher321 icecrasher321 restored the staging-v1 branch July 14, 2026 15:39
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