Migrate user identity matching off stem user id drupal - #2609
Open
A-Wheeto wants to merge 5 commits into
Open
Conversation
…stem_user_id CRUP is permanently removing drupal_id (Auth0's integrationkey claim) stem_user_id was required, unique, and used as the login-matching key in User.from_auth, so every real Auth0 login would start failing once that claim disappears in production. stem_achiever_contact_no (Dynamics/Achiever contact ID) is the durable identifier instead - lookup now orders by last_sign_in_at so accounts with a pre-existing duplicate achiever_contact_no resolve to whichever was most recently active, and stem_user_id is only overwritten when a login actually supplies one, so it won't get silently wiped for existing users once integrationkey stops being sent ENG-2264
report_generation.rake writes user.stem_user_id into this NOT NULL column on every scheduled run. Once real users start having no stem_user_id, that scheduled job would hard-fail on every batch containing one ENG-2264
… API Forget only accepted stem_user_id as a lookup param, which is going away ENG-2264
The presence/uniqueness validation on stem_achiever_contact_no only catches conflicts sequentially - two concurrent first-time logins for the same contact number can both pass the Rails-level check before either commits, since it's just a SELECT that can't see the other's uncommitted insert. A DB-level constraint is the only thing that's atomic across concurrent transactions. ENG-2264
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



No description provided.