this repo has no description

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.

+6 -6
+6 -6
packages/remanso/src/commands/publish.ts
··· 254 254 const pdsDocuments = await listDocuments(ag, config.publicationUri); 255 255 s.stop(`Found ${pdsDocuments.length} documents on PDS`); 256 256 257 - const pathPrefix = "/posts"; 258 - const postsByPath = new Map<string, BlogPost>(); 259 - for (const post of posts) { 260 - postsByPath.set(`${pathPrefix}/${post.slug}`, post); 261 - } 257 + const knownAtUris = new Set( 258 + posts 259 + .map((p) => p.frontmatter.atUri) 260 + .filter((uri): uri is string => uri != null), 261 + ); 262 262 const deletedAtUris = new Set(deletedEntries.map((e) => e.atUri)); 263 263 for (const doc of pdsDocuments) { 264 - if (!postsByPath.has(doc.value.path) && !deletedAtUris.has(doc.uri)) { 264 + if (!knownAtUris.has(doc.uri) && !deletedAtUris.has(doc.uri)) { 265 265 unmatchedEntries.push({ 266 266 atUri: doc.uri, 267 267 title: doc.value.title || doc.value.path,