From c34cc7f3481d43b5bae54a51efc2ae09ca0227b1 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Thu, 26 Feb 2026 14:43:51 +0100 Subject: [PATCH] fix: use AT URI matching to detect local posts in remanso sync 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 documents to appear as unmatched in sync output. --- packages/remanso/src/commands/sync.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/remanso/src/commands/sync.ts b/packages/remanso/src/commands/sync.ts index 24e7105..84afb9a 100644 --- a/packages/remanso/src/commands/sync.ts +++ b/packages/remanso/src/commands/sync.ts @@ -204,12 +204,12 @@ export const syncCommand = command({ ); s.stop(`Found ${localPosts.length} publishable notes (.pub.md)`); - // Build a map of path -> local post for matching - // Use "/posts" prefix (same default as publish command) - const pathPrefix = "/posts"; - const postsByPath = new Map(); + // Build a map from atUri -> local post for matching + const postsByAtUri = new Map(); for (const post of localPosts) { - postsByPath.set(`${pathPrefix}/${post.slug}`, post); + if (post.frontmatter.atUri) { + postsByAtUri.set(post.frontmatter.atUri, post); + } } // Load existing state @@ -225,7 +225,7 @@ export const syncCommand = command({ for (const doc of documents) { const docPath = doc.value.path; - const localPost = postsByPath.get(docPath); + const localPost = postsByAtUri.get(doc.uri); if (localPost) { matchedCount++; -- 2.51.2