From 05a5ec2308b9195f52e3fd153bcfc2c9c1674eec Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Thu, 26 Feb 2026 14:20:27 +0100 Subject: [PATCH] fix: use AT URI matching to detect unmatched PDS records in remanso publish The previous path-based comparison used a hardcoded /posts/{slug} prefix that never matched the actual /pub/{rkey}/{slug} paths stored in PDS records, causing all existing notes to be treated as unmatched and deleted whenever a new note was published. --- packages/remanso/src/commands/publish.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/remanso/src/commands/publish.ts b/packages/remanso/src/commands/publish.ts index eda49de..cc8305d 100644 --- a/packages/remanso/src/commands/publish.ts +++ b/packages/remanso/src/commands/publish.ts @@ -254,14 +254,14 @@ export const publishCommand = command({ const pdsDocuments = await listDocuments(ag, config.publicationUri); s.stop(`Found ${pdsDocuments.length} documents on PDS`); - const pathPrefix = "/posts"; - const postsByPath = new Map(); - for (const post of posts) { - postsByPath.set(`${pathPrefix}/${post.slug}`, post); - } + const knownAtUris = new Set( + posts + .map((p) => p.frontmatter.atUri) + .filter((uri): uri is string => uri != null), + ); const deletedAtUris = new Set(deletedEntries.map((e) => e.atUri)); for (const doc of pdsDocuments) { - if (!postsByPath.has(doc.value.path) && !deletedAtUris.has(doc.uri)) { + if (!knownAtUris.has(doc.uri) && !deletedAtUris.has(doc.uri)) { unmatchedEntries.push({ atUri: doc.uri, title: doc.value.title || doc.value.path, -- 2.51.2