Skip to content

feat(sdk): put the delete check behind enableDeleteCheck - #2050

Merged
rohanchkrabrty merged 4 commits into
mainfrom
feat/sdk-delete-check-flag
Nov 11, 2026
Merged

rohanchkrabrty merged 4 commits into
mainfrom
feat/sdk-delete-check-flag

Conversation

@rohanchkrabrty

@rohanchkrabrty rohanchkrabrty commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add an enableDeleteCheck option to FrontierClientOptions. It is off by default, and client-demo turns it on.
  • When it is on, organization, project and account deletes run the check RPC on click and show the blocked dialog. This is the current flow.
  • When it is off, the delete button opens the confirm dialog directly. The organization page checks on load, disables the button while blocked, and lists the blockers in a tooltip, as it did before feat(sdk): org delete blockers UI #2025.
  • Consumers can keep the new flow in dev and staging while prod servers do not serve CheckProjectDelete (v0.119.0) or CheckCurrentUserDelete (v0.120.0).

Servers before v0.119.0 do not serve CheckProjectDelete, and
CheckCurrentUserDelete came in v0.120.0, so the check on click fails
there. The new enableDeleteCheck option (off by default) turns on the
check on click for organization, project and account deletes. When it
is off, the delete button opens the confirm dialog directly, and the
organization page checks on load and disables the button while
blocked, as it did before.
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
frontier Ready Ready Preview Nov 11, 2026 9:56am UTC

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Summary

Summary by CodeRabbit

  • New Features
    • Added an optional setting to control deletion eligibility checks. It is off by default and enabled in the client demo.
    • Organization deletion is unavailable while an eligibility check is loading or when a blocker is found; blocker details appear in the interface.
    • When checks are disabled, the confirmation step opens without a pre-check. If deletion is refused, the dialog shows a general error message.
    • When checks are enabled, a refusal triggers another eligibility check; no error notification appears if that check is blocked or fails.

The client adds an enableDeleteCheck option. User deletion follows the configured check path. When checks are disabled, the organization view loads deletion eligibility and reflects the result in the delete control and tooltip.

Changes: Deletion check behavior

Layer / File(s) Summary
Deletion-check configuration
web/sdk/shared/types.ts, web/apps/client-demo/src/config/frontier.ts
FrontierClientOptions adds the optional enableDeleteCheck flag. The client demo sets it to true.
User deletion flow
web/sdk/client/hooks/useDeleteCheck.ts, web/sdk/client/components/delete-user-dialog/delete-user-dialog.tsx
When checks are disabled, useDeleteCheck opens the confirmation dialog without calling the check. DeleteUserDialog follows the configured confirmation path. When deletion is refused, it reruns the check only when checks are enabled; otherwise, it closes the dialog and shows a generic blocked-deletion toast.
Organization deletion eligibility
web/sdk/client/views/general/general-view.tsx
When checks are disabled and the user has permission to delete the organization, GeneralView loads eligibility without retrying. The delete control and tooltip reflect loading state, permission, and any reported blockers.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

Merge Risk: Moderate · up to 2c3e7

The new option is meant to let older servers keep working, but account deletion with the check disabled still calls an RPC those servers lack, so confirmed deletions will fail there. The organization delete button can also stay disabled in some edge cases after the option changes. Resolve the account-deletion compatibility gap before merging, or explicitly accept it.

Pre-merge checks: Passed 2

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coveralls

coveralls commented Nov 11, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 42999363634

Coverage remained the same at 56.053%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 42189
Covered Lines: 23648
Line Coverage: 56.05%
Coverage Strength: 19.7 hits per line

💛 - Coveralls

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

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f38ac11 and 5acb2bf.

Files selected for processing: 5

  • web/apps/client-demo/src/config/frontier.ts
  • web/sdk/client/components/delete-user-dialog/delete-user-dialog.tsx
  • web/sdk/client/hooks/useDeleteCheck.ts
  • web/sdk/client/views/general/general-view.tsx
  • web/sdk/shared/types.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

With enableDeleteCheck off, a refused account delete showed the generic
message. The toast now lists the blockers from the delete error with the
current blocker lines, and adds a line for sole ownership.
A disabled query keeps its last data. When the option turns on after the
organization page loaded, the old result kept the delete button disabled.

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

Actionable comments posted: 2

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5acb2bf and b5f28f0.

Files selected for processing: 1

  • web/sdk/client/components/delete-user-dialog/delete-user-dialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@rohanchkrabrty
rohanchkrabrty enabled auto-merge (squash) November 11, 2026 09:57
@rohanchkrabrty
rohanchkrabrty merged commit 885fc0f into main Nov 11, 2026
7 of 8 checks passed
@rohanchkrabrty
rohanchkrabrty deleted the feat/sdk-delete-check-flag branch November 11, 2026 10:02

This branch was successfully deployed

1 active deployment
Preview — 2c3e76ed Deployed Nov 11, 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.

3 participants