Improve story cleanup on expiration/deletion

This commit is contained in:
Scott Nonnenberg 2024-07-02 16:15:17 -07:00 committed by GitHub
parent 39d15ba620
commit bde4fa40fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 15 deletions

View file

@ -139,8 +139,10 @@ async function cleanupStoryReplies(
reply,
'cleanupStoryReplies/1:1'
);
model.set('storyReplyContext', undefined);
await model.hydrateStoryContext(story, { shouldSave: true });
await model.hydrateStoryContext(story, {
shouldSave: true,
isStoryErased: true,
});
})
);
}
@ -157,9 +159,7 @@ export async function deleteMessageData(
await window.Signal.Migrations.deleteExternalMessageFiles(message);
if (isStory(message)) {
// Attachments have been deleted from disk; remove from memory before replies update
const storyWithoutAttachments = { ...message, attachments: undefined };
await cleanupStoryReplies(storyWithoutAttachments);
await cleanupStoryReplies(message);
}
const { sticker } = message;