Page MenuHomePhabricator

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

Authored by kamil on Dec 18 2023, 4:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 28, 9:15 PM
Unknown Object (File)
Fri, Jun 28, 1:27 PM
Unknown Object (File)
Tue, Jun 25, 1:05 AM
Unknown Object (File)
Mon, Jun 24, 10:56 PM
Unknown Object (File)
Sat, Jun 22, 11:12 AM
Unknown Object (File)
Sat, Jun 22, 11:12 AM
Unknown Object (File)
Sat, Jun 22, 11:11 AM
Unknown Object (File)
Sat, Jun 22, 11:11 AM
Subscribers

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Dec 18 2023, 6:47 AM
This revision is now accepted and ready to land.Dec 21 2023, 2:25 AM
marcin requested changes to this revision.Dec 21 2023, 3:20 AM
marcin added inline comments.
native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
616 ↗(On Diff #34785)

This comment is relevant here as well.

This revision now requires changes to proceed.Dec 21 2023, 3:20 AM
This revision is now accepted and ready to land.Jan 2 2024, 5:17 AM