Log envelopes and session end events
Help debug bad session errors by logging some envelope info about the message we are about to decrypt. With this, if there is a decryption error (e.g., bad mac or no session) it is clear from the logs what number and device message sent the bad message. Also log when we send and receive end session messages and when we close sessions for certain devices. // FREEBIE
This commit is contained in:
parent
d686eb4f68
commit
86132a38a8
3 changed files with 22 additions and 4 deletions
|
@ -153,12 +153,14 @@ MessageSender.prototype = {
|
|||
},
|
||||
|
||||
closeSession: function(number, timestamp) {
|
||||
console.log('sending end session');
|
||||
var proto = new textsecure.protobuf.DataMessage();
|
||||
proto.body = "TERMINATE";
|
||||
proto.flags = textsecure.protobuf.DataMessage.Flags.END_SESSION;
|
||||
return this.sendIndividualProto(number, proto, timestamp).then(function(res) {
|
||||
return textsecure.storage.devices.getDeviceObjectsForNumber(number).then(function(devices) {
|
||||
return Promise.all(devices.map(function(device) {
|
||||
console.log('closing session for', device.encodedNumber);
|
||||
return textsecure.protocol_wrapper.closeOpenSessionForDevice(device.encodedNumber);
|
||||
})).then(function() {
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue