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.
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
Creates Backend for Merging User Accounts #117
Creates Backend for Merging User Accounts #117
Changes from 1 commit
d980622
fed8754
ee77e75
5cb3f58
955760e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'd consider not moving existing audit logs, it seems tricky and error-prone, and breaks the idea that audit logs are "write-only".
If it's important to show the merged user info in the UI for this stuff, I'd record merges in a separate table (also without FKCs), and then just do that mapping when users look at the audit logs. A bit more work on the read-side, but it's a straightforward mapping and it removes a bunch of nuance around audit logs.
Instead of a separate table, you could use the
TRANSFER_OWNERSHIP
logs to get the same info, though that make audit logs "load-bearing"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.
I generally agree that editing audit logs is an unstable paradigm.
I think what you propose is also dangerous however, because it introduces much less stable semantics around how audit logs can be accessed and retrieved, which are also an important security end. My thought with doing the data modification in place is that we only have to navigate the complexity of "who should get access to what" at exactly one juncture, and then afterwards queries and reads and creates all need no modification.
I agree using TRANSFER_OWNERSHIP logs is a nightmare which we don't want to descend into.
Not sure how to resolve/move forward on this one.
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.
Option I'm considering: we could do a lookup (by owner + by user) of each of the entity groups just transferred to ensure they're no longer present (similar to what I did at the end of the TXN to transfer audit log ownership). I'd like to hear your thoughts on whether that's a good idea - particularly because the db.DeleteUser call will then delete these elements if they don't transfer.