From b529610bbad5e7fb9ddff379b3fd328a59a5743b Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 28 Feb 2024 21:50:43 -0500 Subject: [PATCH] fix: mainPid detection in unprocessed ids in assertTopic --- src/activitypub/notes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 2b980ade1a..57a853347c 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -240,13 +240,13 @@ Notes.assertTopic = async (uid, id) => { winston.info(`[notes/assertTopic] ${unprocessed.length} new note(s) found.`); const [ids, timestamps] = [ - unprocessed.map(n => n.pid), + unprocessed.map(n => (utils.isNumber(n.pid) ? parseInt(n.pid, 10) : n.pid)), unprocessed.map(n => n.timestamp), ]; // mainPid doesn't belong in posts zset - if (ids.includes(mainPid)) { - const idx = ids.indexOf(mainPid); + if (ids.includes(parseInt(mainPid, 10))) { + const idx = ids.indexOf(parseInt(mainPid, 10)); ids.splice(idx, 1); timestamps.splice(idx, 1); }