From c5733e3551f4f61ae59a1c3d9d34b1b3d8ac8229 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sun, 22 Mar 2026 00:25:29 +0100 Subject: [PATCH] fix: isTagFollowed false positive for global-only follows; # stripping in getTagsPubActorUrl - isTagFollowed() now checks doc?.followedAt instead of !!doc, so it correctly returns false for global-only follows (document exists but no local followedAt) - getTagsPubActorUrl() strips leading # so URLs like ?tag=%23indieweb don't produce invalid https://tags.pub/user/#indieweb actor URLs - Remove stale "Task 5" plan reference comment in tag timeline template --- lib/storage/followed-tags.js | 4 ++-- views/activitypub-tag-timeline.njk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/storage/followed-tags.js b/lib/storage/followed-tags.js index 079ca38..c0cc120 100644 --- a/lib/storage/followed-tags.js +++ b/lib/storage/followed-tags.js @@ -87,7 +87,7 @@ export async function isTagFollowed(collections, tag) { if (!ap_followed_tags) return false; const normalizedTag = tag.toLowerCase().trim().replace(/^#/, ""); const doc = await ap_followed_tags.findOne({ tag: normalizedTag }); - return !!doc; + return !!(doc?.followedAt); } /** @@ -96,7 +96,7 @@ export async function isTagFollowed(collections, tag) { * @returns {string} Actor URL */ export function getTagsPubActorUrl(tag) { - return `https://tags.pub/user/${tag.toLowerCase()}`; + return `https://tags.pub/user/${tag.toLowerCase().replace(/^#/, "")}`; } /** diff --git a/views/activitypub-tag-timeline.njk b/views/activitypub-tag-timeline.njk index 416e594..e8fa036 100644 --- a/views/activitypub-tag-timeline.njk +++ b/views/activitypub-tag-timeline.njk @@ -81,7 +81,7 @@ {% endif %} - {# Infinite scroll sentinel (Task 5) #} + {# Infinite scroll load-more trigger #} {% if before %}