HomePhabricator
Diffusion Comm fb78b9ed8703

[web] Add cryptoStore to shared worker

Description

[web] Add cryptoStore to shared worker

Summary:
[ENG-6650 : Add cryptoStore to shared worker](https://linear.app/comm/issue/ENG-6650/add-cryptostore-to-shared-worker)

Part of the work to synchronize data between browser tabs. This diff moves the cryptoStore to the shared worker. This is hidden behind the flag for now and will be enabled after all diffs are landed.

  • The new worker message INITIALIZE_CRYPTO_ACCOUNT also accepts optional cryptoStore which will be used in a future migration
  • OLM wasm path for webworkers extracted from service worker code
NOTE: currently some parts of olm don't work in the shared worker (more info in the linked issue) but updating our fork will be handled by @kamil.

Depends on D11236

Test Plan:

  • Made sure that olm wasm is downloaded on both dev and in docker (prod)
  • Tested that initializing crypto account creates and persist new accounts
  • Tested that if there are persisted accounts they are used instead
  • Tested that initialCryptoStore ovverides the existing crypto store

Reviewers: kamil, tomek

Reviewed By: kamil

Subscribers: ashoat, kamil

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

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Feb 26 2024, 4:58 AM
Reviewer
kamil
Differential Revision
D11272: [web] Add cryptoStore to shared worker
Parents
rCOMM55eb78480cbf: [web] Move worker database globals to worker-database.js
Branches
Unknown
Tags
Unknown

Event Timeline