Skip to content

Node.js based forum software built for the modern web

fix: unintentional parseInt during post purge

Julian Lambcfac00becaf
diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js
index 689ceca2a6..f1fd7ce89b 100644
--- a/src/activitypub/notes.js
+++ b/src/activitypub/notes.js
@@ -417,4 +417,6 @@ Notes.prune = async () => {
await batch.processArray(tids, async (tids) => {
await Promise.all(tids.map(async tid => await topics.purgePostsAndTopic(tid, 0)));
}, { batch: 100 });
+
+ winston.info('[notes/prune] Scheduled pruning of topics complete.');
};
diff --git a/src/posts/delete.js b/src/posts/delete.js
index e4e4e59438..5a2a615e26 100644
--- a/src/posts/delete.js
+++ b/src/posts/delete.js
@@ -115,7 +115,7 @@ module.exports = function (Posts) {
incrObjectBulk.push([`category:${cid}`, { post_count: -posts.length }]);
}
- const postsByTopic = _.groupBy(postData, p => parseInt(p.tid, 10));
+ const postsByTopic = _.groupBy(postData, p => String(p.tid));
const topicPostCountTasks = [];
const topicTasks = [];
const zsetIncrBulk = [];