HomePhabricator
Diffusion Comm 5ab5ebdad4f1

[keyserver] Fix olm_session_creation_failure bug due to fetchOlmUpdateAccount…

Description

[keyserver] Fix olm_session_creation_failure bug due to fetchOlmUpdateAccount retry

Summary:
I move the call to the identity service outside of the fetchOlmUpdateAccount block, to avoid a scenario where the identity service is uploaded keys that don't get persisted in the keyserver MariaDB.

See here for a description of the issue this resolves (scenario 4).

While working on this diff, I considered a potential risk that the client might end up with keys that don't get uploaded to identity. This situation where the client has more one-time keys than identity can be dangerous if the client ends up with more than 100 one-time keys, and starts pruning them. At that point, the keys pruned in the client might still be on identity.

However, this scenario seems relatively unlikely with the current implementation of one-time key refresh in the keyserver, where we debounce the requests, and they are only initiated when the number of one-time keys drops below 5.

Test Plan: Prior to this diff, I would see olm_session_creation_failure at least once every 10 registration attempts, but usually more frequent. After this diff, I was able to test registering 30 times in a row with no errors

Reviewers: marcin, inka, tomek

Reviewed By: marcin

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

Details

Provenance
ashoatAuthored on Mar 25 2024, 8:33 PM
Reviewer
marcin
Differential Revision
D11384: [keyserver] Fix olm_session_creation_failure bug due to fetchOlmUpdateAccount retry
Parents
rCOMM2c577fabda21: [lib] integrity reducer tests
Branches
Unknown
Tags
Unknown