Workflow drafts: a conflict overwrites the other tab, and save failures are dropped #1944

Closed
opened 2026-11-13 02:49:19 +00:00 by sam · 1 comment
Owner

putDraft failures are retried after 500 ms even on a 409, writing this tab's text over another tab's edit and clearing the "changed elsewhere" message. dropDraft ignores the write result, and an in-flight write returns false with no error, so publish and restore can leave a stale draft with no message.

Done when: a conflict is shown and never retried over; every failed draft write is reported where it happened.

`putDraft` failures are retried after 500 ms even on a 409, writing this tab's text over another tab's edit and clearing the "changed elsewhere" message. `dropDraft` ignores the write result, and an in-flight write returns false with no error, so publish and restore can leave a stale draft with no message. Done when: a conflict is shown and never retried over; every failed draft write is reported where it happened.
sam added the criticalbug labels 2026-11-13 02:49:19 +00:00
Author
Owner

Fixed in f4b7652a. The editor remembers the stored draft it last saw for the open workflow; a write that finds anything else stored stops and shows 'This draft changed in another tab or by Archie' with Load latest and Replace with mine. A server 409 is never retried over; retries happen only while another write is in flight. Discard and Publish now report a draft that wasn't removed. Reproduced first with two pages editing one workflow's YAML 300-600 ms apart: the first page's edit vanished with no message. After: the first edit survives and the second page gets the conflict; both buttons verified; sequential edits and single-page editing still save. No test: it's a timing race, so the fix rules it out by checking what's stored before every write. task check passed.

Fixed in f4b7652a. The editor remembers the stored draft it last saw for the open workflow; a write that finds anything else stored stops and shows 'This draft changed in another tab or by Archie' with Load latest and Replace with mine. A server 409 is never retried over; retries happen only while another write is in flight. Discard and Publish now report a draft that wasn't removed. Reproduced first with two pages editing one workflow's YAML 300-600 ms apart: the first page's edit vanished with no message. After: the first edit survives and the second page gets the conflict; both buttons verified; sequential edits and single-page editing still save. No test: it's a timing race, so the fix rules it out by checking what's stored before every write. task check passed.
sam closed this issue 2026-11-13 03:01:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1944