Page MenuHomePhabricator

[web] Use shared worker crypto store in identity client provider
ClosedPublic

Authored by michal on Mar 22 2024, 8:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 2:56 PM
Unknown Object (File)
Tue, Oct 29, 3:28 PM
Unknown Object (File)
Thu, Oct 24, 5:36 AM
Unknown Object (File)
Tue, Oct 15, 2:34 PM
Unknown Object (File)
Tue, Oct 15, 2:34 PM
Unknown Object (File)
Tue, Oct 15, 2:34 PM
Unknown Object (File)
Tue, Oct 15, 2:34 PM
Unknown Object (File)
Tue, Oct 15, 2:34 PM
Subscribers

Details

Summary

ENG-6656 : Update the web code to use new cryptoStore

Previously implemented in D11348 but some issues have been noticed and the required changes were large enough that I decided to split them into a separate diff. I'm taking a similar approach to native where I fetch the auth metadata on every call to identity. In case of web if the auth metadata changed between calls I then send the CREATE_IDENTITY_SERVICE_CLIENT worker message which should recreate the identity client with correct auth metadata. Thanks to D11299, this call will resolve before the actual call to the identity client.

Also decided to merge the previously created worker proxy inside of the IdentityServiceContextProvider as it simplified the code a lot (also now it's even more similar to native where the context just returns a plain JS object).

Depends on D11372

Test Plan
  • Called generateNonce (success), called getKeyserverKeys (failed because user wasn't logged in)
  • Logged in to identity
  • Called the two methods again. Now both of the succeeded

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

web/grpc/identity-service-context-provider.react.js
52–53 ↗(On Diff #38278)

Do these need to be sequential?

kamil added inline comments.
web/grpc/identity-service-context-provider.react.js
55 ↗(On Diff #38278)

can we reverse that and return early?

This revision is now accepted and ready to land.Mar 27 2024, 12:26 AM