this repo has no description
0
fork

Configure Feed

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

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.

+6 -6
+6 -6
packages/remanso/src/commands/sync.ts
··· 204 204 ); 205 205 s.stop(`Found ${localPosts.length} publishable notes (.pub.md)`); 206 206 207 - // Build a map of path -> local post for matching 208 - // Use "/posts" prefix (same default as publish command) 209 - const pathPrefix = "/posts"; 210 - const postsByPath = new Map<string, (typeof localPosts)[0]>(); 207 + // Build a map from atUri -> local post for matching 208 + const postsByAtUri = new Map<string, (typeof localPosts)[0]>(); 211 209 for (const post of localPosts) { 212 - postsByPath.set(`${pathPrefix}/${post.slug}`, post); 210 + if (post.frontmatter.atUri) { 211 + postsByAtUri.set(post.frontmatter.atUri, post); 212 + } 213 213 } 214 214 215 215 // Load existing state ··· 225 225 226 226 for (const doc of documents) { 227 227 const docPath = doc.value.path; 228 - const localPost = postsByPath.get(docPath); 228 + const localPost = postsByAtUri.get(doc.uri); 229 229 230 230 if (localPost) { 231 231 matchedCount++;