-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(project-creation): Rollback when rules fail to be created #103208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(project-creation): Rollback when rules fail to be created #103208
Conversation
| return {project, notificationRule, ruleIds}; | ||
| } catch (error) { | ||
| // Attach project for rollback | ||
| (error as RequestError & {createdProject: Project}).createdProject = project; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, I would prefer a type safe alternative. Why are we not doing the rollback in this hook where we have all the information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean the rollback right here or inside of the onError of this hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
for me it would make sense as it is the responsibility of the hook to orchestrate those two requests. As soon as we do it outside the hook, we actually need knowledge about its internals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it makes sense. will update the code! thank you
…n-rules-fail-to-be-created
closes https://linear.app/getsentry/issue/TET-1369/user-confusion-when-project-creation-fails-but-succeeds
Example (after the fix):
Screen.Recording.2025-11-12.at.07.04.16.mov