Expiring messages: Add clarifying comment about destroy() ordering

FREEBIE
pull/749/head
Scott Nonnenberg 8 years ago
parent 7d4ae63501
commit 832b343031

@ -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…
Cancel
Save