Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32507294
D13901.1767038799.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D13901.1767038799.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
Mon, Dec 29, 8:06 PM (16 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5865835
Default Alt Text
D13901.1767038799.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