Skip to content

Commit bea3045

Browse files
cdervclaude
andcommitted
Add debug log for 404 in resolveTarget, clarify Test 9b expectations
During production testing, deleted content was silently handled by resolveTarget returning undefined (correct behavior). Added debug logging for the 404 case to match the existing deleted-state logging. Updated README to document the actual flow: silent detection, no prompt for stale target, falls through to new publish. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 07fb4b0 commit bea3045

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/publish/posit-connect-cloud/posit-connect-cloud.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ async function resolveTarget(
307307
};
308308
} catch (err) {
309309
if (err instanceof ApiError && err.status === 404) {
310+
publishDebug(
311+
`Content ${target.id} not found (404), treating as not found`,
312+
);
310313
return undefined;
311314
}
312315
throw err;

tests/docs/manual/publish-connect-cloud/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,11 @@ unset POSIT_CONNECT_CLOUD_ACCESS_TOKEN
292292
./package/dist/bin/quarto.cmd publish posit-connect-cloud tests/docs/manual/publish-connect-cloud/single-doc/document.qmd
293293
```
294294

295-
- [ ] Detects content is gone (deleted or 404)
296-
- [ ] Prompts as new publish (or creates new content)
295+
- [ ] Silently detects content is gone via `resolveTarget` (debug log: "not found" or "deleted")
296+
- [ ] No "Publish update to:" prompt for the deleted target
297+
- [ ] Falls through to new publish flow ("Publish with account:" prompt)
297298
- [ ] Publishes successfully with new content ID
299+
- [ ] Old stale entry remains in `_publish.yml` (not cleaned up — known limitation)
298300

299301
### 9c: --no-render Flag
300302

0 commit comments

Comments
 (0)