Skip to content

improvement(whitelabeling): gate the settings page on the whitelabel read's entitlement - #8451

Merged
waleedlatif1 merged 2 commits into
stagingfrom
improvement/whitelabeling-settings-load
Sep 30, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
improvement/whitelabeling-settings-load

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The whitelabeling settings page blocked on the full organization billing read (the member page plus every member's usage for the period) only to read the plan name, so it was the slowest settings section to open
  • The whitelabel GET now also returns isEnterprise, which is the same entitlement check the update enforces. This matches how the session-policy and data-retention reads already work. The page gates on that field and makes no billing request, and the workspace branding provider usually has this read cached already
  • The gate now matches what saving allows. The server page gate only checks the plan on hosted deployments, so with self-hosted billing a team-plan org previously saw the form and then got a 403 on save. It now sees the Enterprise-only message
  • The change is additive, so it is safe across a deploy: isEnterprise sits beside data, not inside it. A client from before this field parses the same settings, so branding keeps its theme and the form never loads empty
  • The Copilot settings tool still returns the flat settings object it returned before

Type of Change

  • Improvement

Testing

  • E2E against a production build with 80 ms network latency and billing enabled:
    • Enterprise org, sidebar navigation: the form renders in 138–167 ms, down from 240–360 ms, with 0 billing requests
    • Enterprise org, direct load: the form renders and the org theme is still injected
    • Team-plan org: the Enterprise-only message shows with no form, and PUT still returns 403
    • Old-client compat check: the previous response schema still parses the settings from the new response
  • bun run lint, type-check, check:audits, docs-manifest:check, block registry check
  • 52 test files (419 tests) across whitelabeling, organizations, settings, the Copilot settings tool and the organization routes

Checklist

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

…read's entitlement

The page blocked on the full organization billing read (member page plus each member's usage ledger for the period) only to check the plan name. The whitelabel read now also returns the entitlement the update enforces, as the session-policy and data-retention reads do, as an additive field beside `data` so clients from before it parse the same response. The page renders after that one read, which the workspace branding provider usually has cached, and its gate now matches what saving allows.
@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 30, 2026 5:58am UTC

Request Review

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Changes the whitelabel settings API contract and access control.

The PR appears safe to merge; no outstanding findings remain.

Summary

The whitelabel read now returns the save-time entitlement alongside unchanged settings data, allowing the settings page to gate without a billing request. Branding and the Copilot settings tool retain their settings-only behavior. The latest change makes the new client accept responses from older servers that omit the entitlement.

Reviews (2) · Last reviewed commit: "fix(whitelabeling): parse the whitelabel..."

Comment thread apps/sim/lib/api/contracts/organization.ts Outdated
Comment thread apps/sim/ee/whitelabeling/components/whitelabeling-settings.tsx
Comment thread apps/sim/ee/whitelabeling/components/whitelabeling-settings.tsx
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 10726ce into staging Sep 30, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/whitelabeling-settings-load branch September 30, 2026 06:48

This branch was previously deployed

1 inactive deployment
Preview — 104f2a68 Deployed Sep 30, 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