A CLI for publishing standard.site documents to ATProto sequoia.pub
standard site lexicon cli publishing

fix: preserve PDS-side fields (e.g. bskyPostRef) on document update #32

updateDocument previously built a fresh record from frontmatter only and called putRecord, silently dropping any PDS-side fields such as bskyPostRef. This broke the <sequoia-comments> web component after the first re-publish.

Fix: fetch the existing record with getRecord before writing, spread its fields into the new record, then overwrite with the fresh frontmatter-derived values. This preserves all PDS-side fields while still updating the document content correctly.

Fixes stevedylandev/sequoia#5

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:i2fgba5nignuw4nccml33wjp/sh.tangled.repo.pull/3mfgnvfjdzp22
+9
Diff #0
+9
packages/cli/src/lib/atproto.ts
··· 322 322 textContent = stripMarkdownForText(post.content); 323 323 } 324 324 325 + // Fetch existing record to preserve PDS-side fields (e.g. bskyPostRef) 326 + const existingResponse = await agent.com.atproto.repo.getRecord({ 327 + repo: agent.did!, 328 + collection: collection!, 329 + rkey: rkey!, 330 + }); 331 + const existingRecord = existingResponse.data.value as Record<string, unknown>; 332 + 325 333 const record: Record<string, unknown> = { 334 + ...existingRecord, 326 335 $type: "site.standard.document", 327 336 title: post.frontmatter.title, 328 337 site: config.publicationUri,

History

1 round 0 comments
sign up or login to add to the discussion
1 commit
expand
fix: preserve PDS-side fields (e.g. bskyPostRef) on document update
expand 0 comments
pull request successfully merged