Skip to content

Conversation

@ameliahsu
Copy link
Member

@ameliahsu ameliahsu commented Nov 21, 2025

system-created monitors should not be deleted by anyone, regardless of permissions

closes https://linear.app/getsentry/issue/NEW-647/disable-bulk-delete-in-ui-when-selection-includes-error-monitors

@ameliahsu ameliahsu requested a review from a team as a code owner November 21, 2025 18:40
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 21, 2025
@linear
Copy link

linear bot commented Nov 21, 2025

@kcons
Copy link
Member

kcons commented Nov 21, 2025

we should probably do this in the api too, right? I can if you're not planning it.

@ameliahsu
Copy link
Member Author

@kcons making the backend PR now!

const [allInQuerySelected, setAllInQuerySelected] = useState(false);
const anySelected = selected.size > 0;

const canDelete = canEdit && !hasSystemCreatedDetectors;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Delete enabled for query with system-created monitors

When using "Select all X monitors that match this search query", the canDelete check only considers system-created monitors on the current page. If the current page has only user-created monitors but other pages in the query results contain system-created monitors, the Delete button remains enabled. Clicking Delete would then attempt to delete all monitors matching the query, including system-created ones on other pages, bypassing the intended protection.

Fix in Cursor Fix in Web

@ameliahsu ameliahsu merged commit 11e4a63 into master Nov 21, 2025
49 checks passed
@ameliahsu ameliahsu deleted the mia/aci/fe-prevent-deleting-system-created-monitors branch November 21, 2025 23:12
ameliahsu added a commit that referenced this pull request Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants