Page MenuHomePhabricator

[native] Introduce code to call keyserver for registration in new flow
ClosedPublic

Authored by ashoat on Jun 8 2023, 6:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 3:01 AM
Unknown Object (File)
Fri, Nov 22, 10:58 PM
Unknown Object (File)
Wed, Nov 13, 7:05 PM
Unknown Object (File)
Thu, Nov 7, 11:00 AM
Unknown Object (File)
Thu, Nov 7, 11:00 AM
Unknown Object (File)
Thu, Nov 7, 11:00 AM
Unknown Object (File)
Thu, Nov 7, 10:59 AM
Unknown Object (File)
Thu, Nov 7, 10:59 AM
Subscribers

Details

Summary

This is the code that will actually register a user (ENG-4047). Some notes:

  1. I initially considered passing the avatar directly to the registration endpoint, but realized that gets complicated since we need a logged-in user in order to do a media upload. Instead here I first register the user, and in a later diff I'll handle setting the user's avatar.
  2. We don't yet have a screen for accepting terms (ENG-3951). For now I'm calling the registration endpoint from AvatarSelection, but after introducing a screen for accepting terms I'll move the registration call.

Depends on D8148

Test Plan

The whole stack was tested as follows:

  1. Try creating an account with the default avatar
  2. Try creating an account with an emoji avatar
  3. Try creating an account with an image avatar (that needs to be uploaded)
  4. Try creating an Ethereum account with an ENS avatar

I made sure of the following:

  1. Loading spinner appeared on the button, not on the avatar, and was present throughout
  2. After the RegistrationNavigator is dismissed, the avatar that appears for the user's PRIVATE chat in the ChatThreadList is correct
  3. Subsequent delete-account-and-then-register-again worked correctly
  4. Various error cases are triggered correctly

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/account/registration/avatar-selection.react.js
96–98 ↗(On Diff #27559)

This makes it so registrationMode is turned off during actual registration. It's not really strictly necessary until we need setUserAvatar to actually hit the keyserver in D8152 (instead of being captured locally, as happens with registrationMode: 'on'). But I figured it made sense to introduce the change here alongside registrationInProgress

ashoat requested review of this revision.Jun 8 2023, 7:25 AM
This revision is now accepted and ready to land.Jun 9 2023, 12:09 PM