Page MenuHomePhabricator

[identity] check if fid is already taken when registering new user
ClosedPublic

Authored by varun on Mar 27 2024, 1:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 1:29 AM
Unknown Object (File)
Fri, Apr 12, 1:29 AM
Unknown Object (File)
Fri, Apr 12, 1:29 AM
Unknown Object (File)
Fri, Apr 12, 1:29 AM
Unknown Object (File)
Thu, Apr 11, 3:12 PM
Unknown Object (File)
Tue, Apr 9, 9:38 AM
Unknown Object (File)
Sat, Apr 6, 7:16 AM
Unknown Object (File)
Wed, Apr 3, 9:00 PM
Subscribers

Details

Summary

we shouldn't let multiple Comm users associate the same FID with their accounts. So, we need to check on registration if the FID is already taken.

Depends on D11411

Test Plan

tried registering a user with an FID that was already in the users table, it failed as expected. Registration with a new FID (not in DDB) continues to work, though.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Mar 27 2024, 1:49 PM

@varun looking at the test plan here, is it fair to say you weren't able to reproduce ENG-7390? Is it worth trying to test via the UI to see if that reproduces it?

@varun looking at the test plan here, is it fair to say you weren't able to reproduce ENG-7390? Is it worth trying to test via the UI to see if that reproduces it?

I was able to repro, left some comments on the issue explaining what happened

Read the issue and seems like it was unrelated to this code.

Logic looks good, the only possible way it could fail is if somebody could trigger two registrations so quickly that the DDB index wouldn't have chance to be updated between them (it's milliseconds IIRC). But the only way to address this is to rate-limit registrations.

This revision is now accepted and ready to land.Wed, Mar 27, 11:57 PM