From cc0bbcb7bf5d68916980a02d8c273c51050a9767 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 28 Jun 2024 16:28:34 -0400 Subject: [PATCH] fix: push instead of unshift, now that order is reversed --- src/activitypub/notes.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/activitypub/notes.js b/src/activitypub/notes.js index 2209dda8f4..7d195b8797 100644 --- a/src/activitypub/notes.js +++ b/src/activitypub/notes.js @@ -70,7 +70,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => { } const members = await db.isSortedSetMembers(`tid:${tid}:posts`, chain.slice(0, -1).map(p => p.pid)); - members.push(await posts.exists(mainPid)); + members.unshift(await posts.exists(mainPid)); if (tid && members.every(Boolean)) { // All cached, return early. // winston.verbose('[notes/assert] No new notes to process.'); @@ -122,18 +122,6 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => { const count = unprocessed.length; // winston.verbose(`[notes/assert] ${count} new note(s) found.`); - const [ids, timestamps] = [ - 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); - ids.splice(idx, 1); - timestamps.splice(idx, 1); - } - let tags; if (!hasTid) { const { to, cc, attachment } = mainPost._activitypub;