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
F3384041: D11373.id38278.diff
Thu, Nov 28, 7:08 PM
F3384033: D11373.id38355.diff
Thu, Nov 28, 7:05 PM
Unknown Object (File)
Mon, Nov 25, 1:44 AM
Unknown Object (File)
Mon, Nov 18, 4:09 AM
Unknown Object (File)
Wed, Nov 6, 2:56 PM
Unknown Object (File)
Oct 29 2024, 3:28 PM
Unknown Object (File)
Oct 24 2024, 5:36 AM
Unknown Object (File)
Oct 15 2024, 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