lamina-idempotency-concurrency

Solid

Duplicate actions and simultaneous edits — double-submit, concurrent admin updates, and safe retries in product behavior. Use when shared resources can be mutated by multiple actors or requests.

Code & Development 65 stars 2 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 82/100

Stars 20%
61
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
94
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Idempotency and Concurrency Design product behavior so duplicate actions and simultaneous edits cannot break invariants — without prescribing database locks or frameworks. ## Decision frameworks - **Idempotent operation**: Repeating the action has the same effect as once (click "generate ticket" twice → still one ticket). - When to use: Any create or payment action. - How: Disable button after submit; show existing result on repeat; scenarios for double-click. - **Concurrent edit conflict**: Two actors change the same resource (two admins assign different venues). - When to use: Shared admin resources, collaborative editing. - How: Last-write-wins with audit, optimistic conflict UI, or lock-while-editing — document product choice in `scenarios`. - **Fencing**: Stale action cannot apply after state changed (regenerate ticket on exam already completed → blocked with clear reason). ## Checklists 1. List mutating operations; mark which must be idempotent. 2. For shared editable resources, define conflict behavior. 3. Design UX for in-flight requests (disabled submit, progress). 4. Write scenarios: `concurrent_edit`, duplicate submit, stale action. 5. Verify phase: attempt duplicate and concurrent paths on live product. ## Anti-patterns - **Double ticket on double-click**: No idempotency on create. - **Silent overwrite**: Admin B's venue change lost without notice. - **Optimistic UI without rollback**: Show success then revert confusingly. ## Examples - **Two ...

Details

Author
aryaniyaps
Repository
aryaniyaps/lamina
Created
3 weeks ago
Last Updated
today
Language
TypeScript
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category