diff --git a/js/models/messages.js b/js/models/messages.js index 313678a26..866c5e04c 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -2222,8 +2222,11 @@ async handleReaction(reaction) { const reactions = this.get('reactions') || []; + const messageId = this.idForLogging(); + const count = reactions.length; if (reaction.get('remove')) { + window.log.info('Removing reaction for message', messageId); const newReactions = reactions.filter( re => re.emoji !== reaction.get('emoji') || @@ -2231,6 +2234,7 @@ ); this.set({ reactions: newReactions }); } else { + window.log.info('Adding reaction for message', messageId); const newReactions = reactions.filter( re => re.fromId !== reaction.get('fromId') ); @@ -2247,6 +2251,11 @@ } } + const newCount = this.get('reactions').length; + window.log.info( + `Done processing reaction for message ${messageId}. Went from ${count} to ${newCount} reactions.` + ); + await window.Signal.Data.saveMessage(this.attributes, { Message: Whisper.Message, });