Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3184562
D13901.id45725.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13901.id45725.diff
View Options
diff --git a/lib/tunnelbroker/use-peer-to-peer-message-handler.js b/lib/tunnelbroker/use-peer-to-peer-message-handler.js
--- a/lib/tunnelbroker/use-peer-to-peer-message-handler.js
+++ b/lib/tunnelbroker/use-peer-to-peer-message-handler.js
@@ -323,6 +323,21 @@
);
return;
}
+
+ if (errorMessage.includes(olmSessionErrors.alreadyDecrypted)) {
+ const sqliteMessages = await sqliteAPI.getInboundP2PMessagesByID([
+ messageID,
+ ]);
+ if (sqliteMessages.length > 0) {
+ console.log(
+ 'Message skipped because it was already decrypted ' +
+ `messageId: ${messageID}` +
+ `sender: ${message.senderInfo.deviceID}.`,
+ );
+ return;
+ }
+ }
+
console.log(
'Error decrypting message from device ' +
`${message.senderInfo.deviceID}: ${errorMessage}`,
diff --git a/lib/utils/olm-utils.js b/lib/utils/olm-utils.js
--- a/lib/utils/olm-utils.js
+++ b/lib/utils/olm-utils.js
@@ -128,6 +128,7 @@
// the corresponding .cpp file
// at `native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp`.
invalidSessionVersion: 'INVALID_SESSION_VERSION',
+ alreadyDecrypted: `${OLM_SESSION_ERROR_PREFIX}ALREADY_DECRYPTED_OR_KEYS_SKIPPED`,
});
function hasHigherDeviceID(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 11:05 AM (16 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2451118
Default Alt Text
D13901.id45725.diff (1 KB)
Attached To
Mode
D13901: [lib] Do not reset a session when getting already decrypted message
Attached
Detach File
Event Timeline
Log In to Comment