docs(drafts): trim the removal-marker invariant to four lines

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcyBRxE8j3ujCYkum9KrC4
This commit is contained in:
Diego Imbert
2026-09-06 18:27:56 +02:00
co-authored by Claude Opus 5
parent df06cc20fc
commit e1859f504d
@@ -6179,12 +6179,10 @@ async function discardLocalDraft(
await deleteGlobalDraft(workspace, type, path, triggerKind)
// Published only now: the delete above can throw, and the marker is read by the
// tool-completion listener, which a throw never reaches — leaving it to be
// consumed by some later action on this item, which would send its editor away
// while the item is still there. Nor is it published when a write is queued
// behind the delete: the form stays editable across it, and an edit made then
// recreates the draft, so the item the marker would report as gone is not.
// Published only now, and only if nothing is queued behind the delete: the marker
// sends a hosted editor away from an item it says is gone, so a throw above must
// not leave one standing for a later action to spend, and an edit made across the
// delete recreates the draft — leaving the item the marker would report as gone.
if (removesItem && discardedKind) {
const settled =
UserDraftDbSyncer.getState({ workspace, itemKind: discardedKind, path: storagePath })