Page MenuHomePhabricator

D13027.diff
No OneTemporary

D13027.diff

diff --git a/lib/tunnelbroker/peer-to-peer-context.js b/lib/tunnelbroker/peer-to-peer-context.js
--- a/lib/tunnelbroker/peer-to-peer-context.js
+++ b/lib/tunnelbroker/peer-to-peer-context.js
@@ -30,6 +30,7 @@
} from '../types/tunnelbroker/peer-to-peer-message-types.js';
import { getConfig } from '../utils/config.js';
import { getMessageForException } from '../utils/errors.js';
+import { olmSessionErrors } from '../utils/olm-utils.js';
import { useDispatch, useSelector } from '../utils/redux-utils.js';
type PeerToPeerContextType = {
@@ -132,6 +133,10 @@
};
await sendMessageToPeer(encryptedMessage);
} catch (e) {
+ if (!e.message?.includes(olmSessionErrors.sessionDoesNotExists)) {
+ console.log(`Error sending messages to peer ${peerDeviceID}`, e);
+ break;
+ }
try {
await peerOlmSessionsCreator(message.userID, peerDeviceID);
const result = await olmAPI.encryptAndPersist(
@@ -287,7 +292,14 @@
deviceID: recipient.deviceID,
payload: JSON.stringify(encryptedMessage),
});
- } catch {
+ } catch (e) {
+ if (!e.message?.includes(olmSessionErrors.sessionDoesNotExists)) {
+ console.log(
+ `Error sending messages to peer ${recipient.deviceID}`,
+ e,
+ );
+ return;
+ }
try {
await peerOlmSessionsCreator(recipient.userID, recipient.deviceID);
const encryptedData = await olmAPI.encrypt(

File Metadata

Mime Type
text/plain
Expires
Fri, Sep 20, 3:16 PM (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2150958
Default Alt Text
D13027.diff (1 KB)

Event Timeline