Remove expired message if it expired during database fetch (#1983)

* Log SyncMessage destination, even if it's a group

* Remove disappearing message even if deleted during fetch

This change fixes a potential race condition with disappearing message
removal from the UI. If the UI is in the middle of making a database
request for messages to display, then we need to wait for that to
complete before removing the newly-deleted expired message.
This commit is contained in:
Scott Nonnenberg 2018-01-23 12:27:34 -08:00 committed by GitHub
parent b2a3a0e679
commit fb2ebddaa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

View file

@ -595,8 +595,12 @@ MessageReceiver.prototype.extend({
}
if (syncMessage.sent) {
var sentMessage = syncMessage.sent;
var to = sentMessage.message.group
? 'group(' + sentMessage.message.group.id.toBinary() + ')'
: sentMessage.destination;
console.log('sent message to',
sentMessage.destination,
to,
sentMessage.timestamp.toNumber(),
'from',
this.getEnvelopeId(envelope)