fix(account): update stored procedures to be more replication friendly #410
Conversation
235a104
to
3c1dd5a
Compare
END; | ||
|
||
-- Update session verification methods | ||
UPDATE `sessionTokens` SET verificationMethod = verificationMethodArg, verifiedAt = verifiedAtArg |
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 significantly tweaked this procedure to only update the verificationMethod
on the session table. All previous logic was pulled into the db.verifyTokensWithMethod
procedure.
WHERE tokenVerificationId = @tokenVerificationId | ||
AND uid = uidArg; | ||
|
||
DELETE FROM unverifiedTokens |
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 simplified this by removing the transaction portion, which will return the affectedRows
from the DELETE
. I don't remember the original logic why I put this in a transaction but think it is ok to remove.
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.
What a pain. It does kinda wanna be a transaction (I logged it, I did it), but...
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.
lgtm
This PR updates our stored procedures to be more replication friendly and is targeted against train-121.