diff --git a/lib/utils/peer-to-peer-communication-utils.js b/lib/utils/peer-to-peer-communication-utils.js --- a/lib/utils/peer-to-peer-communication-utils.js +++ b/lib/utils/peer-to-peer-communication-utils.js @@ -100,6 +100,10 @@ getMessageForException(e)?.includes(olmSessionErrors.sessionDoesNotExist) ) { resultDescription = 'session is missing'; + // We optimistically try encrypting the message without checking if the + // session has been created. This is okay because in case of missing + // session, encryption will be retried after session creation. + success = true; return 'missing_session'; } resultDescription = `Error sending messages to peer ${message.deviceID}: ${