Page MenuHomePhabricator

[native] use findUserID RPC in UsernameSelection component
ClosedPublic

Authored by varun on Mar 13 2024, 6:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 12:49 PM
Unknown Object (File)
Thu, Apr 25, 12:48 PM
Unknown Object (File)
Thu, Apr 25, 12:22 AM
Unknown Object (File)
Wed, Apr 10, 6:46 AM
Unknown Object (File)
Mar 23 2024, 12:28 PM
Unknown Object (File)
Mar 20 2024, 11:37 PM
Unknown Object (File)
Mar 20 2024, 3:11 AM
Unknown Object (File)
Mar 19 2024, 7:01 PM
Subscribers

Details

Summary

If usingCommServicesAccessToken, we should call the identity service RPC instead of the keyserver exactSearchUser API

if the username is reserved or registered on the identity service, we should set the username_taken error

Test Plan

enabled usingCSAT and tried to register an already registered and a reserved username, both failed with the username_taken error

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Mar 13 2024, 7:11 PM
bartek added inline comments.
native/account/registration/username-selection.react.js
95–97 ↗(On Diff #38047)

As a follow up, it'd be good to create a wrapper over commRustModule.findUserIDFor___() which returns proper flow-typed FindUserIDResponse = { +userID: string; +isReserved: boolean }, optionally also checked with a validator.

ashoat added inline comments.
native/account/registration/username-selection.react.js
95–97 ↗(On Diff #38047)

@varun can you create a task for this? I wonder if it should be in IdentityServiceClient

104 ↗(On Diff #38047)

It looks like this logic changed. If you're sure it's okay to change, you can leave as-is. I haven't dug into whether this change is okay, but it would be really simple to just keep the old logic

This revision is now accepted and ready to land.Mar 15 2024, 10:34 AM
native/account/registration/username-selection.react.js
95–97 ↗(On Diff #38047)