HomePhabricator
Diffusion Comm c95d85e89e2f

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

Description

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

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

Reviewers: kamil, tomek, bartek

Reviewed By: kamil, bartek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D11373