From ddd4118c53242f6864987c4c5cff0b9704121ee0 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:48:29 -0700 Subject: [PATCH] Ensure messageCache is updated when properties are unset Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com> --- ts/jobs/helpers/sendReaction.ts | 2 +- ts/models/messages.ts | 2 +- ts/util/cleanup.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ts/jobs/helpers/sendReaction.ts b/ts/jobs/helpers/sendReaction.ts index 7a21d185f..d95e002ec 100644 --- a/ts/jobs/helpers/sendReaction.ts +++ b/ts/jobs/helpers/sendReaction.ts @@ -382,7 +382,7 @@ const setReactions = ( if (reactions.length) { message.set('reactions', reactions); } else { - message.unset('reactions'); + message.set('reactions', undefined); } }; diff --git a/ts/models/messages.ts b/ts/models/messages.ts index 8c82ebea8..6789e2574 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -491,7 +491,7 @@ export class MessageModel extends window.Backbone.Model { } if (this.get('storyReplyContext')) { - this.unset('storyReplyContext'); + this.set('storyReplyContext', undefined); } await this.hydrateStoryContext(message.attributes, { shouldSave: true }); return; diff --git a/ts/util/cleanup.ts b/ts/util/cleanup.ts index ef4f5d188..0fb5cf09f 100644 --- a/ts/util/cleanup.ts +++ b/ts/util/cleanup.ts @@ -89,7 +89,7 @@ async function cleanupStoryReplies( reply, 'cleanupStoryReplies/1:1' ); - model.unset('storyReplyContext'); + model.set('storyReplyContext', undefined); await model.hydrateStoryContext(story, { shouldSave: true }); }) );