From 88b91c20d907bb312bf25a7314e27dc944c61571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 3 Mar 2026 12:54:14 -0500 Subject: [PATCH] refactor: move resolve flags and activitypub.out.remove.context after topic deletion --- src/topics/delete.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/topics/delete.js b/src/topics/delete.js index 6df951c0eb..086609a667 100644 --- a/src/topics/delete.js +++ b/src/topics/delete.js @@ -20,16 +20,17 @@ module.exports = function (Topics) { ]); await Promise.all([ db.sortedSetRemove(`cid:${cid}:pids`, pids), - resolveTopicPostFlags(pids, uid), Topics.setTopicFields(tid, { deleted: 1, deleterUid: uid, deletedTimestamp: Date.now(), }), - activitypub.out.remove.context(uid, tid), ]); - - await categories.updateRecentTidForCid(cid); + await Promise.all([ + resolveTopicPostFlags(pids, uid), + activitypub.out.remove.context(uid, tid), + categories.updateRecentTidForCid(cid), + ]); }; async function resolveTopicPostFlags(pids, uid) {