Files
KArtSell.Aegis/docs/CURRENT/AEG-V16-022_OPTIMISTIC_COMMAND_SLICE_NOTE.md
T
kjh2064 a750858dfe fix: preserve idempotency keys across command retries (AEG-V16-022)
Create one immutable request per user intent so retries forward the same key; preserve concurrency conflict handling and execution evidence.
2026-08-08 13:35:30 +09:00

21 lines
1.3 KiB
Markdown

# AEG-V16-022 — Optimistic command hook
## Scope
- **WBS / Requirement / UI / Test:** AEG-V16-022 / REQ-V16-FEC-06 / UI-V16-FEC-06 / T-V16-FEC-06
- **Classification:** shared command-boundary correctness fix; no API, DB, policy, or provider change.
## Source / Assumption / Unknown / Decision Required
- **Source:** `AGENTS.md` idempotency rule, `frontend/src/shared/commands/idempotency.*`, and `useOptimisticCommand.*`.
- **Assumption:** the caller creates one request per user intent and reuses that request for retry. Server idempotency remains the authoritative side-effect protection.
- **Unknown:** no CRUD screen currently consumes this hook; integration evidence remains a later screen-slice responsibility.
- **Decision Required:** predecessor AEG-V16-021 has no concrete consumer yet; this implementation does not claim its acceptance evidence.
## Execution evidence
- `createRequest()` freezes a request with an idempotency key once; `run()` forwards that exact key on every retry.
- `If-Match`, 409/412 conflict state, correlation capture, and pending reset are preserved.
- `frontend: pnpm test -- --run src/shared/crud/tests/useOptimisticCommand.spec.ts`: 1 file / 2 tests passed.
- `frontend: pnpm typecheck`: passed before JS companion synchronization; the later JS-only synchronization is covered by the passing runtime test.