Repository navigation
Demo 14: compensation under fire - #17
Merged
Merged
Conversation
…s, replayed events A second LinkedIn reader asked to see duplicate events and timeouts during compensation. - Inventory demo switch (slow_reserve / slow_release, 6 s, past order's 3 s timeout). - A release for a hold inventory never saw is recorded as RELEASED (and logged), so a hold that arrives late holds nothing. Before, that late hold kept the stock held for good. - Release counts every copy it receives (releases_received), so the page shows the timed-out direct call and its event copy both arrived and the stock came back once. - POST /api/order/sagas/<id>/replay resends a checkout's events with the same ids; inventory counts what it skipped (duplicates_skipped) and what is not its business (not_handled). - Demo switches share shop_common.flask_support.DemoSwitch and one switches_off() answer. - Page /patterns/compensation, README section 14, smoke tests for the 3 live cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A second reader of the LinkedIn post asked to see duplicate events and timeouts during compensation. Looking for them found a real gap: a release that beat its slow hold left the late hold, and its stock, held for good.
What changed
DemoSwitch) and one "switches are off" answer, used by payment, inventory and order./patterns/compensation, plus README section 14 with a screenshot.Tests
🤖 Generated with Claude Code