Resolve conflicts in series
Attempting to resolve outgoing conflicts in parallel triggers multiple requests for new keys from the server and causes it to return a 500 error.
This commit is contained in:
parent
f3f084398f
commit
3e73f8f0ba
2 changed files with 6 additions and 1 deletions
|
@ -273,11 +273,15 @@
|
||||||
|
|
||||||
return textsecure.storage.axolotl.removeIdentityKey(number).then(function() {
|
return textsecure.storage.axolotl.removeIdentityKey(number).then(function() {
|
||||||
return textsecure.storage.axolotl.putIdentityKey(number, identityKey).then(function() {
|
return textsecure.storage.axolotl.putIdentityKey(number, identityKey).then(function() {
|
||||||
|
var promise = Promise.resolve();
|
||||||
this.messageCollection.each(function(message) {
|
this.messageCollection.each(function(message) {
|
||||||
if (message.hasKeyConflict(number)) {
|
if (message.hasKeyConflict(number)) {
|
||||||
message.resolveConflict(number);
|
promise = promise.then(function() {
|
||||||
|
return message.resolveConflict(number);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return promise;
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
|
@ -121,6 +121,7 @@
|
||||||
this.save({sent: true, errors: errors});
|
this.save({sent: true, errors: errors});
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
|
return promise;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleDataMessage: function(dataMessage) {
|
handleDataMessage: function(dataMessage) {
|
||||||
|
|
Loading…
Reference in a new issue