HomePhabricator
Diffusion Comm f38ca8fbc503

[CommCoreModule] persist account after generating prekeys and one-time keys

Description

[CommCoreModule] persist account after generating prekeys and one-time keys

Summary:
initializeCryptoAccount is idempotent method which is called many-times from JS code, and it relies on reading account from storage.
When we run getPrimaryOneTimeKeys or generateAndGetPrekeys at the beginnig to auth with Identity without persisting, then JS could call initializeCryptoAccount which overate state with keys generated, and later when creating inbound session olm throws OLM_BAD_MESSAGE_KEY_ID because init message was created with unknown one-time keys.

Context in ENG-6098.

Depends on D10371

Test Plan: Call getPrimaryOneTimeKeys and generateAndGetPrekeys and verify (using Logger) if it caused updating values in DB.

Reviewers: marcin, varun, michal

Reviewed By: marcin

Subscribers: ashoat, tomek

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

Details

Provenance
kamilAuthored on Dec 17 2023, 4:14 AM
Reviewer
marcin
Differential Revision
D10372: [CommCoreModule] persist account after generating prekeys and one-time keys
Parents
rCOMMa0993d58c9a8: [CommCoreModule] implement method to persist `olm` account
Branches
Unknown
Tags
Unknown