- Notifications
You must be signed in to change notification settings - Fork923
fix: add postgres triggers to remove deleted users from user_links#12117
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Emyrk commentedFeb 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed by Graphite.Learn more about stacking. |
6f09151
to24e767f
Compare4113828
tob7fd329
CompareWhy are we removing the ability to undelete a user? |
Emyrk commentedFeb 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
We never exposed this via the CLI or the API. It only exists in the DB query. However, un-deleting a user is more work than just the query that I removed. It can now collide with existing users, their Essentially undeleting a user can cause issues (if it can succeed at all), so we never supported it. And we should remove the query that will very likely fail in prod. I fear someone would just add a query param, use the existing query, merge it (because we do not test deleted users very much in tests). Then almost immediately it'll cause issues in an actual database. |
I know we never supported it, but it feels odd to keep the soft delete and areal delete. Can we change it to completely do one or the other? |
We do not support hard deletes at all on most resources. For auditing purposes, we need to keep these objects around. |
@Emyrk I'm confused why weshould then on users. It seems like a fork in the road. It seems better to either leave this and not permit undeleting a user (e.g. actually blocking it), or making it work instead of allowing it for a single resource type. |
I do not totally follow. The product feature set is unchanged. We previously only supported soft deleting users from the API. I just made the DB query reflect this, so nowyou cannot un-delete users even from a DB query. So just trying to prevent developer error. The |
24e767f
tob0c3cbb
CompareChanging emails on github fails if another deleted user existswith the same link.
56b8a0d
toa54b652
CompareThere 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.
Even though it is idiomatic with our data structure, I'm a bit nervous about having a term "soft delete" in one resource, even though I know we have it in others.
We've coined the termdeleted
as a soft-delete already. And since we called itUpdateDeleted
I feel like it's a bit more confusing to call thisSoftDelete
now.
A few questions:
- Can we just fix this in the Go code? Do we need to have the triggers added? It seems harder to test, and more spread complexity.
- Is it alright if we continue to use
UpdateDeleted
instead ofSoftDelete
? Does my rationale make sense in this context?
How about I return the name to |
That sounds good to me! |
Uh oh!
There was an error while loading.Please reload this page.
What this does
un-delete
a user. We never exposed this outside the db layer, doing this to make that decision something that takes more thought than just changing an api param.