Node.js based forum software built for the modern web
fix: on topics' internal method deleteTopics, call topics.purgePostsAndTopic so other users' posts are not orphaned
Julian Lam2f5e2f04508a
diff --git a/src/user/delete.js b/src/user/delete.jsindex 6568d8bc4a..ff33d90aeb 100644--- a/src/user/delete.js+++ b/src/user/delete.js@@ -53,7 +53,7 @@ module.exports = function (User) {async function deleteTopics(callerUid, uid) {await batch.processSortedSet(`uid:${uid}:topics`, async (tids) => {- await topics.purge(tids, callerUid);+ await topics.purgePostsAndTopic(tids, callerUid);await db.sortedSetRemove(`uid:${uid}:topics`, tids);}, { alwaysStartAt: 0, batch: 100 });}