HomePhabricator
Diffusion Comm 8f961a60668c

[lib] create session with peer only when it is missing

Description

[lib] create session with peer only when it is missing

Summary:
ENG-6982.

ENG-8527.

We definitely shouldn't attempt to create a session when sending a message using Tunnelbroker fails.
According to Olm docs encrypt could throw only two errors:

  • NOT_ENOUGH_RANDOM
  • OUTPUT_BUFFER_TOO_SMALL

and attempting to create a session for those two is not to attempt new session creation, the only case is when the session is missing.

The alternative is to not update the code because peerOlmSessionsCreator is idempotent but we can avoid additional worker/CommCoreModule calls.

Depends on D13025

Test Plan: Test that when session is missing, it is created.

Reviewers: marcin, tomek

Reviewed By: tomek

Subscribers: ashoat

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

Details

Provenance
kamilAuthored on Aug 8 2024, 4:05 AM
Reviewer
tomek
Differential Revision
D13027: [lib] create session with peer only when it is missing
Parents
rCOMM037276f8296f: [web][native] unify errors from `CryptoModule` on web and native
Branches
Unknown
Tags
Unknown