fix: mainPid detection in unprocessed ids in assertTopic

This commit is contained in:
Julian Lam
2024-02-28 21:50:43 -05:00
parent 0cf6af9b6c
commit b529610bba

View File

@@ -240,13 +240,13 @@ Notes.assertTopic = async (uid, id) => {
winston.info(`[notes/assertTopic] ${unprocessed.length} new note(s) found.`); winston.info(`[notes/assertTopic] ${unprocessed.length} new note(s) found.`);
const [ids, timestamps] = [ 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), unprocessed.map(n => n.timestamp),
]; ];
// mainPid doesn't belong in posts zset // mainPid doesn't belong in posts zset
if (ids.includes(mainPid)) { if (ids.includes(parseInt(mainPid, 10))) {
const idx = ids.indexOf(mainPid); const idx = ids.indexOf(parseInt(mainPid, 10));
ids.splice(idx, 1); ids.splice(idx, 1);
timestamps.splice(idx, 1); timestamps.splice(idx, 1);
} }