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, Dec 24, 12:24 AM
Unknown Object (File)
Tue, Dec 24, 12:24 AM
Unknown Object (File)
Tue, Dec 24, 12:24 AM
Unknown Object (File)
Tue, Dec 24, 12:23 AM
Unknown Object (File)
Tue, Dec 24, 12:23 AM
Unknown Object (File)
Thu, Dec 5, 12:12 AM
Unknown Object (File)
Wed, Dec 4, 8:52 PM
Unknown Object (File)
Sun, Dec 1, 6:29 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