Expiring messages: Add clarifying comment about destroy() ordering
FREEBIE
This commit is contained in:
parent
7d4ae63501
commit
832b343031
1 changed files with 3 additions and 0 deletions
|
@ -12,6 +12,9 @@
|
|||
expired.on('add', function(message) {
|
||||
console.log('message', message.get('sent_at'), 'expired');
|
||||
message.getConversation().trigger('expired', message);
|
||||
|
||||
// We delete after the trigger to allow the conversation time to process
|
||||
// the expiration before the message is removed from the database.
|
||||
message.destroy();
|
||||
});
|
||||
expired.on('reset', checkExpiringMessages);
|
||||
|
|
Loading…
Add table
Reference in a new issue