Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit b0ed2e5

Browse files
committed
Fix check for session equivalence
This check didn't work, which resulted in closing and then immediately reopening the current session. Not that big a deal, since it merely flips a flag off and back on again just before saving the session record, but does result in spurious log statements.
1 parent b77842c commit b0ed2e5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/libsignal-protocol.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36177,7 +36177,7 @@ SessionCipher.prototype = {
3617736177
var errors = [];
3617836178
return this.decryptWithSessionList(buffer, record.getSessions(), errors).then(function(result) {
3617936179
return this.getRecord(address).then(function(record) {
36180-
if (result.session !== record.getOpenSession()) {
36180+
if (result.session.indexInfo.baseKey !== record.getOpenSession().indexInfo.baseKey) {
3618136181
record.archiveCurrentState();
3618236182
record.promoteState(result.session);
3618336183
}

src/SessionCipher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ SessionCipher.prototype = {
143143
var errors = [];
144144
return this.decryptWithSessionList(buffer, record.getSessions(), errors).then(function(result) {
145145
return this.getRecord(address).then(function(record) {
146-
if (result.session !== record.getOpenSession()) {
146+
if (result.session.indexInfo.baseKey !== record.getOpenSession().indexInfo.baseKey) {
147147
record.archiveCurrentState();
148148
record.promoteState(result.session);
149149
}

0 commit comments

Comments
 (0)