Page MenuHomePhabricator

[native] use findUserID RPC in UsernameSelection component
ClosedPublic

Authored by varun on Mar 13 2024, 6:55 PM.
Tags
None
Referenced Files
F3522722: D11320.diff
Mon, Dec 23, 7:29 AM
Unknown Object (File)
Nov 20 2024, 1:18 AM
Unknown Object (File)
Nov 20 2024, 1:18 AM
Unknown Object (File)
Oct 23 2024, 9:12 AM
Unknown Object (File)
Oct 23 2024, 9:12 AM
Unknown Object (File)
Oct 23 2024, 9:11 AM
Unknown Object (File)
Oct 18 2024, 1:58 PM
Unknown Object (File)
Sep 16 2024, 10:05 AM
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)