From d7a49d51637b257bd3c1a85ed8d097780a0d9985 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Mon, 9 Feb 2026 00:08:22 +0100 Subject: [PATCH] fix: preserve rkey when republishing with missing state When a post's state entry is missing but its frontmatter already contains an atUri, use "update" instead of "create" to preserve the existing rkey and avoid duplicate records. --- packages/cli/src/commands/publish.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/commands/publish.ts b/packages/cli/src/commands/publish.ts index 4998076..825f2d8 100644 --- a/packages/cli/src/commands/publish.ts +++ b/packages/cli/src/commands/publish.ts @@ -186,11 +186,10 @@ export const publishCommand = command({ reason: "forced", }); } else if (!postState) { - // New post postsToPublish.push({ post, - action: "create", - reason: "new post", + action: post.frontmatter.atUri ? "update" : "create", + reason: post.frontmatter.atUri ? "missing state" : "new post", }); } else if (postState.contentHash !== contentHash) { // Changed post -- 2.51.2