From ff08fbb73fa59509f94186718f06305707044416 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 1 Aug 2024 14:59:28 -0400 Subject: [PATCH] fix: always send replies uri instead of null if no replies exist, @trwnh --- src/activitypub/helpers.js | 2 ++ src/activitypub/mocks.js | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/activitypub/helpers.js b/src/activitypub/helpers.js index f27a1a5d60..f46d2644c9 100644 --- a/src/activitypub/helpers.js +++ b/src/activitypub/helpers.js @@ -398,6 +398,8 @@ Helpers.generateCollection = async ({ set, method, page, perPage, url }) => { object.next = page < pageCount ? `${url}?page=${page + 1}` : null; object.prev = page > 1 ? `${url}?page=${page - 1}` : null; } + } else { + object.orderedItems = []; } if (paginate) { diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index 144efa51f2..dad00dce6d 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -386,8 +386,6 @@ Mocks.note = async (post) => { return payload; }); - const replyCount = await db.sortedSetCard(`pid:${post.pid}:replies`); - const object = { '@context': 'https://www.w3.org/ns/activitystreams', id, @@ -407,7 +405,7 @@ Mocks.note = async (post) => { source, tag, attachment, - replies: replyCount > 0 ? `${id}/replies` : null, + replies: `${id}/replies`, }; return object;