a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

de-duplicate backlinks from constellation

+7 -2
+7 -2
app/lish/[did]/[publication]/[rkey]/getPostPageData.ts
··· 27 27 const postUrl = `https://${pubRecord?.base_path}/${rkey}`; 28 28 const constellationBacklinks = await getConstellationBacklinks(postUrl); 29 29 30 - // Combine database mentions and constellation backlinks 30 + // Deduplicate constellation backlinks (same post could appear in both links and embeds) 31 + const uniqueBacklinks = Array.from( 32 + new Map(constellationBacklinks.map((b) => [b.uri, b])).values(), 33 + ); 34 + 35 + // Combine database mentions (already deduplicated by DB constraint) and constellation backlinks 31 36 const quotesAndMentions: { uri: string; link?: string }[] = [ 32 37 // Database mentions (quotes with link to quoted content) 33 38 ...document.document_mentions_in_bsky.map((m) => ({ ··· 35 40 link: m.link, 36 41 })), 37 42 // Constellation backlinks (direct post mentions without quote context) 38 - ...constellationBacklinks, 43 + ...uniqueBacklinks, 39 44 ]; 40 45 41 46 return {