Page MenuHomePhabricator

[native] Run initializeCryptoAccount once at a time
ClosedPublic

Authored by ashoat on Sep 30 2024, 11:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 2:10 PM
Unknown Object (File)
Mon, Dec 16, 2:10 PM
Unknown Object (File)
Mon, Dec 16, 2:10 PM
Unknown Object (File)
Mon, Dec 16, 2:10 PM
Unknown Object (File)
Wed, Dec 4, 10:17 PM
Unknown Object (File)
Sat, Nov 23, 3:19 AM
Unknown Object (File)
Thu, Nov 21, 10:52 PM
Unknown Object (File)
Thu, Nov 21, 10:44 PM
Subscribers
None

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Changing reviewers so we can land this today before the launch build

This revision is now accepted and ready to land.Sep 30 2024, 12:04 PM