Repository navigation
fix(loot): keep concurrent promotions on one live roll - #439
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughLoot-roll promotion now reuses an unresolved roll for the same corpse and slot. The change preserves its votes and state, while resolved rolls can be recreated. An ignored integration test covers concurrent promotions and distinct roll inputs. ChangesLoot-roll promotion
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Concurrent promotions now reuse one unresolved loot roll, preserving its votes and roll state. The covered behavior is ready to merge with no active current-head risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
7b11e68 to
94c5d5e
Compare
|
Current-head review on
CodeRabbit's prior review found no actionable issue. I did not add comments to the small test helpers for its docstring-percentage warning because repository standards reserve comments for constraints and contracts. This PR covers duplicate START calls while a Loot Roll is active. Issue #441 remains open for a delayed START after resolution and cleanup. |
|
@coderabbitai review |
|
Two Gateways can promote the same staging Loot Roll before either clears it. Each promotion created a separate Realm-core roll and vote set, so party votes could split.
Reuse the existing roll for the corpse and slot through the
by_corpseindex. The Module transaction serializes the lookup and insertion. A repeat promotion preserves the first roll's votes, recipients, item, and deadline.Refs #63. This satisfies #63's scoped acceptance: two concurrent
realm_loot_opSTART calls for one corpse and slot now produce exactly one Loot Roll with one complete vote set. Resolution still deletes the roll and votes, so a delayed START after resolution can create another roll. That separate lifecycle decision is tracked by #441.Verification:
realm_loot_opSTART calls now produce one roll and three voter rows, checked through SQL.cargo test -p lyracore-module --lib --features=debug_reducers: 1,477 passed../lyracore preflight, formatting, and diff checks passed. The regression creates its own loopback node, storage, and CLI configuration. It does not access an existing Realm or production.Authored by GPT-6 Astra through Codex. Current-head review completed by GPT-5.6 Sol in Codex/T3 Code.