Make Draft filing admission atomic and retry-safe #631

Closed
opened 2026-08-12 07:50:02 +00:00 by timmy · 0 comments
Owner

Problem

A mobile Draft is admitted to the durable issue outbox before its source Draft cleanup completes. If attachment or metadata cleanup fails, retrying can enqueue a second operation and create duplicate issues/uploads.

User value

One tap to file a Draft must produce at most one queued/upstream issue across cleanup failures, retries, and reloads.

Acceptance tests

  • A stable source Draft identity is persisted with its outbox operation.
  • Retrying admission for the same source Draft reuses the original item and operation ID.
  • Durable retry reconciles the existing item rather than adding another.
  • Failure before admission creates no outbox item; cleanup failure leaves one retryable item.
  • Ordinary non-Draft captures continue to create independent operations.
  • Focused tests and the full suite pass.

Evidence: frontend/dashboard.js admits at the create form submit path before unfiledCaptures.completeResume; frontend/issue-outbox.js currently allocates a fresh ID per enqueue. Historical issue/commit review found sequential filing and cleanup rollback work, but no source-Draft-to-outbox idempotent handoff.

## Problem A mobile Draft is admitted to the durable issue outbox before its source Draft cleanup completes. If attachment or metadata cleanup fails, retrying can enqueue a second operation and create duplicate issues/uploads. ## User value One tap to file a Draft must produce at most one queued/upstream issue across cleanup failures, retries, and reloads. ## Acceptance tests - A stable source Draft identity is persisted with its outbox operation. - Retrying admission for the same source Draft reuses the original item and operation ID. - Durable retry reconciles the existing item rather than adding another. - Failure before admission creates no outbox item; cleanup failure leaves one retryable item. - Ordinary non-Draft captures continue to create independent operations. - Focused tests and the full suite pass. Evidence: `frontend/dashboard.js` admits at the create form submit path before `unfiledCaptures.completeResume`; `frontend/issue-outbox.js` currently allocates a fresh ID per enqueue. Historical issue/commit review found sequential filing and cleanup rollback work, but no source-Draft-to-outbox idempotent handoff.
timmy self-assigned this 2026-08-12 07:50:02 +00:00
timmy closed this issue 2026-08-12 07:57:54 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#631
No description provided.