Make authored actions idempotent across restarts and workers #201

Closed
opened 2026-08-07 14:28:38 +00:00 by timmy · 0 comments
Owner

Problem

The dashboard keeps authored-action and issue-creation idempotency results only in process memory. A deployment, crash, or request routed to another worker forgets a browser-retained key and can duplicate an issue, comment, reply, or review.

Vertical slice

Replace process-local completed-operation tracking with a bounded SQLite ledger that atomically reserves keys, persists successful responses for the existing TTL, rejects changed payloads, coordinates workers, and fails closed for orphaned in-flight mutations. Apply it to issue creation and all authored actions.

Acceptance tests

  • A completed operation replays after app/ledger reconstruction without a second upstream mutation.
  • Two independent ledger connections cannot reserve the same key concurrently.
  • Reusing a key for a changed payload returns 409.
  • An orphaned pending key does not blindly repeat the upstream mutation.
  • Expired records are cleaned through an indexed timestamp and capacity stays bounded.
  • Existing focused and full test suites remain green.

No open/closed issue or recent commit covers restart-safe or multi-worker idempotency; #177/#185 only introduced process-local retry protection.

## Problem The dashboard keeps authored-action and issue-creation idempotency results only in process memory. A deployment, crash, or request routed to another worker forgets a browser-retained key and can duplicate an issue, comment, reply, or review. ## Vertical slice Replace process-local completed-operation tracking with a bounded SQLite ledger that atomically reserves keys, persists successful responses for the existing TTL, rejects changed payloads, coordinates workers, and fails closed for orphaned in-flight mutations. Apply it to issue creation and all authored actions. ## Acceptance tests - A completed operation replays after app/ledger reconstruction without a second upstream mutation. - Two independent ledger connections cannot reserve the same key concurrently. - Reusing a key for a changed payload returns 409. - An orphaned pending key does not blindly repeat the upstream mutation. - Expired records are cleaned through an indexed timestamp and capacity stays bounded. - Existing focused and full test suites remain green. No open/closed issue or recent commit covers restart-safe or multi-worker idempotency; #177/#185 only introduced process-local retry protection.
timmy self-assigned this 2026-08-07 14:28:38 +00:00
timmy closed this issue 2026-08-07 14:38:07 +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#201
No description provided.