HomePhabricator
Diffusion Comm fa08da2a669e

[native] Run initializeCryptoAccount once at a time

Description

[native] Run initializeCryptoAccount once at a time

Summary:
In ENG-9416, we discovered an issue that can be caused when a bunch of initializeCryptoAccount operations clog up the crypto thread queue. They can be rather slow, and when multiple are enqueued at the same time, they can result in data from one call being replaced by data from another.

To avoid these risks, this diff makes sure we only call initializeCryptoAccount once at a time.

Test Plan: I added logs to initializeCryptoAccount and createOlmSessionsWithUser. Before this diff, when we needed to construct Olm sessions for multiple users, each createOlmSessionsWithUser call would result in a initializeCryptoAccount call. After this diff, there is only one initializeCryptoAccount call for all of the createOlmSessionsWithUser calls.

Reviewers: varun, will

Reviewed By: will

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

Details

Provenance
ashoatAuthored on Sep 30 2024, 11:09 AM
Reviewer
will
Differential Revision
D13523: [native] Run initializeCryptoAccount once at a time
Parents
rCOMM6eea5aaa53ce: [lib] Enable thick thread creation for all the users
Branches
Unknown
Tags
Unknown