Summary
Held-order restore is not a single-consumer operation across terminals. Two terminals can read the same local hold and both proceed with restoration because the server DELETE is idempotent and the client ignores whether it actually deleted the row.
Current behavior
frontend/src/store/held-orders.ts:71-81 returns the local order after DELETE without checking the server deletion result.
main/routes/held-orders.ts:170-188 treats deleting an already-consumed hold as a successful no-op.
Expected behavior
Only one terminal should consume a held order. A stale second consumer should receive a conflict/not-found result and must not restore the order locally.
Acceptance criteria
- Implement conditional consume semantics returning the order only when this request consumed it.
- Handle stale local state and clear/reload the client cache appropriately.
- Add a two-client concurrent restore test.
- Preserve shared-floor behavior for listing holds unless ownership policy changes.
Relevant files
main/routes/held-orders.ts, frontend/src/store/held-orders.ts
Summary
Held-order restore is not a single-consumer operation across terminals. Two terminals can read the same local hold and both proceed with restoration because the server DELETE is idempotent and the client ignores whether it actually deleted the row.
Current behavior
frontend/src/store/held-orders.ts:71-81returns the local order after DELETE without checking the server deletion result.main/routes/held-orders.ts:170-188treats deleting an already-consumed hold as a successful no-op.Expected behavior
Only one terminal should consume a held order. A stale second consumer should receive a conflict/not-found result and must not restore the order locally.
Acceptance criteria
Relevant files
main/routes/held-orders.ts,frontend/src/store/held-orders.ts