feat(examples): demonstrate durable reservation idempotency - #14
Conversation
yordis
commented
Sep 9, 2026
- Queue redelivery must converge on one durable operation outcome even when workers crash between inventory writes and acknowledgements.
- Competing retries need bounded deduplication without retaining every processed operation in inventory state.
- The guarantees around event identity and expected revision need to be explicit enough to prevent accidental duplicate reservations or releases.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryLow Risk Overview Operation IDs are now deterministic from a job key ( The demo scenario is expanded: early claim before inventory read, crash between inventory commit and operation completion, racing competing reservations, persisted sold-out rejections, and stream timelines. Reviewed by Cursor Bugbot for commit fd8e3f7. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe example now uses deterministic UUID v5 operation IDs and per-operation event streams. It validates operation recovery, retries delivery, coordinates inventory writes, and demonstrates replay, conflicts, reservation races, and sold-out rejection. ChangesIdempotent reservation state machine
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🔵 Low · up to The new idempotent reservation example is mergeable with low risk, though it may fail to compile on older Rust configurations or fail a recovery assertion if position semantics differ. Sequence Diagram(s)sequenceDiagram
participant Client
participant execute_operation
participant OperationStream
participant InventoryStream
Client->>execute_operation: submit reservation operation
execute_operation->>OperationStream: claim operation
OperationStream-->>execute_operation: Requested state
execute_operation->>OperationStream: append Prepared or Rejected
execute_operation->>InventoryStream: append reservation event
InventoryStream-->>execute_operation: committed write or conflict
execute_operation->>OperationStream: append Completed or Conflicted
execute_operation-->>Client: terminal outcome
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 2.94% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit reads each line, Comment |