Workflow editor: a failed draft save is dropped without retry or message #1731

Closed
opened 2026-11-02 04:12:22 +00:00 by sam · 1 comment
Owner

persistDraft in ui/src/workflows/WorkflowEditor.vue:190-202 retries only while draftState.saving is true. Otherwise a failed putDraft is not retried, and the editor's alert (:574-576) shows the workflows store's error, not the draft store's. From code reading, an unsaved edit can be lost with nothing shown; not yet reproduced against a running stack.

Done when: a failed draft write is retried or shown in the editor, and an unsaved edit is never discarded without saying so.

`persistDraft` in `ui/src/workflows/WorkflowEditor.vue:190-202` retries only while `draftState.saving` is true. Otherwise a failed `putDraft` is not retried, and the editor's alert (`:574-576`) shows the workflows store's error, not the draft store's. From code reading, an unsaved edit can be lost with nothing shown; not yet reproduced against a running stack. Done when: a failed draft write is retried or shown in the editor, and an unsaved edit is never discarded without saying so.
sam added the highbug labels 2026-11-02 04:12:22 +00:00
sam self-assigned this 2026-11-02 04:12:22 +00:00
Author
Owner

Fixed in ca107f69. The retry branch in persistDraft could never run: it checked draftState.saving after the await, but settings.replace clears saving in its finally before resolving false. persistDraft now retries a failed write on a bounded schedule (5 attempts, 500ms apart) regardless of the saving flag, and if it still fails it sets localError — the editor's alert shows the draft store's own error (workflows.draftState.error) or "Draft not saved — your edit is still in the editor.", so an unsaved edit is never discarded silently. Verified: task check passed on the committed tree. Still worth a manual check against the live stack since the issue was code-read only.

Fixed in ca107f69. The retry branch in persistDraft could never run: it checked draftState.saving after the await, but settings.replace clears saving in its finally before resolving false. persistDraft now retries a failed write on a bounded schedule (5 attempts, 500ms apart) regardless of the saving flag, and if it still fails it sets localError — the editor's alert shows the draft store's own error (workflows.draftState.error) or "Draft not saved — your edit is still in the editor.", so an unsaved edit is never discarded silently. Verified: task check passed on the committed tree. Still worth a manual check against the live stack since the issue was code-read only.
sam closed this issue 2026-11-06 11:34:50 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1731