Skip to content

Conversation

cathteng
Copy link
Member

@cathteng cathteng commented Oct 7, 2025

Merge after #100930

When deleting a Sentry app install, we queue it for deletion in the above PR, so we should show this state to the FE.

After the DELETE call is successful, update the FE state of the current installation to pending_deletion and also update buttons and labels.

@cathteng cathteng requested review from a team and leeandher October 7, 2025 21:36
@cathteng cathteng changed the title add pending deletion state for sentry app installs chore(eco): add pending deletion state for sentry app installs Oct 7, 2025
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 7, 2025
Comment on lines +232 to 236
(existingData = []) =>
existingData.map(i =>
i.app.slug === sentryApp.slug ? {...i, status: 'pending_deletion'} : i
)
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential bug: The frontend optimistically sets an installation's status to 'pending_deletion', but the backend immediately deletes the record, causing state inconsistency.
  • Description: When a user uninstalls a Sentry App, the frontend sends a DELETE request and then optimistically updates the local state of the installation to have a status of 'pending_deletion'. However, the backend API endpoint immediately and synchronously deletes the installation record from the database, rather than marking it for asynchronous deletion. The backend does not support a 'pending_deletion' status. This mismatch causes the frontend to display an installation as 'Pending Deletion' when it has already been removed from the backend, leading to state inconsistency and potential errors on subsequent data fetches for that installation.

  • Suggested fix: Align the frontend and backend behavior. Either the backend should be updated to support asynchronous deletion with a pending_deletion status, or the frontend should be changed to immediately remove the uninstalled application from its local state upon a successful DELETE API response, instead of setting the 'pending_deletion' status.
    severity: 0.65, confidence: 0.98

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Member Author

Choose a reason for hiding this comment

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

bestie you don't even knowwwww

Copy link
Member Author

Choose a reason for hiding this comment

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

read my PR descriptionnnnnn

Copy link
Contributor

@Christinarlong Christinarlong left a comment

Choose a reason for hiding this comment

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

niceeeeee

Copy link
Contributor

@Christinarlong Christinarlong left a comment

Choose a reason for hiding this comment

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

lol added an actual comment but would be nice to see an image

cursor[bot]

This comment was marked as outdated.

@cathteng cathteng enabled auto-merge (squash) October 8, 2025 18:06
@cathteng cathteng merged commit 31317a6 into master Oct 8, 2025
47 checks passed
@cathteng cathteng deleted the cathy/eco/sentry-app-install-async-deletion-fe branch October 8, 2025 18:17

export const getSentryAppInstallStatus = (install: SentryAppInstallation | undefined) => {
if (install) {
if (install && install.status !== 'pending_deletion') {
Copy link
Member

Choose a reason for hiding this comment

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

Have we updated the APIs to return sentry apps that are pending deletion? Also, is there an enum we can reference for object status? Seems fairly generic.

Copy link
Member Author

Choose a reason for hiding this comment

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

The status looks like this https://github.com/getsentry/sentry/pull/101125/files#diff-b2f09d35e3f0947a8312823f96c548de7361dc682c81b6f9c272b7a97408baf4R270

Everything is returned unless it has been "soft deleted", in which case the object manager will not return it

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.

3 participants