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)
Tue, Apr 9, 2:17 PM
Unknown Object (File)
Mon, Apr 8, 7:43 PM
Unknown Object (File)
Sun, Apr 7, 10:37 PM
Unknown Object (File)
Sat, Apr 6, 10:40 AM
Unknown Object (File)
Sat, Apr 6, 6:00 AM
Unknown Object (File)
Wed, Apr 3, 2:32 PM
Unknown Object (File)
Wed, Apr 3, 7:33 AM
Unknown Object (File)
Wed, Apr 3, 2:07 AM
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