Page MenuHomePhabricator

[keyserver] call Identity service RegisterUser RPC from createAccount
ClosedPublic

Authored by varun on Mar 2 2023, 7:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 15, 3:48 PM
Unknown Object (File)
Feb 27 2024, 11:27 PM
Unknown Object (File)
Feb 27 2024, 11:27 PM
Unknown Object (File)
Feb 27 2024, 11:27 PM
Unknown Object (File)
Feb 27 2024, 11:27 PM
Unknown Object (File)
Feb 27 2024, 11:26 PM
Unknown Object (File)
Feb 21 2024, 2:32 AM
Unknown Object (File)
Feb 20 2024, 9:54 PM
Subscribers

Details

Summary
  • fixed the registerUser function type in lib
  • call registerUser from createAccount if the signedIdentityKeysBlob is present

Depends on D6914

Test Plan
  • first, I created a new account on mobile with username/password; saw that the correct user data was in the user and token tables in DDB
  • second, logged out and back in on web; nothing changed in users table
  • third, logged in on web, saw that a new device was added to the users table and a new access token was added to the tokens table

also tested that if we're disconnected from the identity service for whatever reason, nothing crashes on the keyserver

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Mar 2 2023, 7:17 PM

I don't see anything I feel strongly about, I'll keep on the queue for others

ashoat added inline comments.
keyserver/src/creators/account-creator.js
125 ↗(On Diff #23386)
192 ↗(On Diff #23386)

We could initiate this call earlier so that it has more time to complete, but I'm not sure how long it takes. Right now you're waiting for several awaits before you start this call, but you could start it before any of the awaits to give it more time

lib/types/rust-binding-types.js
21 ↗(On Diff #23386)

I think it'd be better to be more specific – see this comment on D6914

This revision is now accepted and ready to land.Mar 3 2023, 8:59 AM
varun marked an inline comment as done.

address feedback

keyserver/src/creators/account-creator.js
192 ↗(On Diff #23386)

makes sense

lib/types/rust-binding-types.js
21 ↗(On Diff #23386)

linked linear task on the other diff, will follow up on this before EOD

keyserver/src/creators/account-creator.js
127

@jon's approach in D6944 is actually probably better... I should've suggested that. Basically we don't need to wait on getRustAPI() at all since we're wrapping the call with handleAsyncPromise. So instead we can construct a promise that composes getRustAPI() with the later call