You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(sdk): put the delete check behind enableDeleteCheck - #2050
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.
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.
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.
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.
raystack/frontier#2042: Adds DeleteUserDialog and the user deletion check flow changed here.
raystack/frontier#2025: Adds organization deletion checks and blocker formatting used here.
raystack/frontier#2041: Adds project deletion checks through useDeleteCheck, which this change updates to honor the configuration flag.
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: 2
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
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
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.
Summary
enableDeleteCheckoption toFrontierClientOptions. It is off by default, and client-demo turns it on.CheckProjectDelete(v0.119.0) orCheckCurrentUserDelete(v0.120.0).