-
Notifications
You must be signed in to change notification settings - Fork 655
AO3-7249 Track past emails and usernames via a separate table #5533
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?
Conversation
…ons, and add rows on changes to columns of users table
|
Right now the PR has 2 parts of 3 from what's required. The last part asks for reverting a previous PR which i'm unsure if I should do inside a commit here |
brianjaustin
left a comment
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.
We usually don't mind reverting a previous PR as part of a newer, larger one. However, we did end up splitting that part out into a separate ticket (https://otwarchive.atlassian.net/browse/AO3-7251) for safety (writing and reading in the same PR is a recipe for a messy deploy), so good instinct there 😅
Some comments for you when you have time
…t_emails and past_usernames
|
Right now I use the old name + timestamp to uniquely identify a change. This works in testing but isn't guaranteed to work in production because audit and table entry timestamps don't have to match. Actual unique identifying would take an extra database table |
This might require ruby instead of SQL (which means a small possibility of race conditions, which is fine), but what about checking old value + timestamp within a resolution of 60 seconds? That way, we can account for a delay between the change and callback execution in the vast majority of cases |
|
That's easily possible to do in SQL. Since it's batching by user, no race conditions are possible either. |
brianjaustin
left a comment
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.
Thanks!
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7249
Purpose
This PR adds new tables for storing old usernames and emails to prevent needing to query the audits table, which can be large for old accounts and doesn't easily support an index. This allows cleaning up the audits table and increasing performance of querying old credentials
References
AO3-7216 is supposed to be reverted as part of this PR
Credit
kiyazz (he/him)