Skip to content

Compensate a shipping failure and isolate a failing error handler - #8

Merged
alejandrolunatech merged 1 commit into
mainfrom
claude/project-thread-cz20zy
Oct 23, 2026
Merged

alejandrolunatech merged 1 commit into
mainfrom
claude/project-thread-cz20zy

Conversation

@alejandrolunatech

Copy link
Copy Markdown
Owner

Requested by Alejandro · project thread

Two gaps that Codex found while reviewing the study guide built on this repo (alejandrolunatech/study-guides#2).

Facade

If shipping.book failed after the charge, placeOrder threw, so the customer was charged, the stock stayed reserved, and no order was placed.

  • Shipping.book now documents a ShippingUnavailableException, and Payments gains refund(paymentReference).
  • The facade undoes the completed steps newest first: it refunds the payment, releases the reservation, and returns Rejected("shipping unavailable: …").
  • New test refundsAndReleasesWhenShippingIsUnavailable. The tests now use a FakePayments, because Payments has two methods and can no longer be a lambda.

Observer

If the error handler itself threw, publish stopped, and the remaining listeners never got the event.

  • EventBus now contains the handler's exception and moves on to the next listener. The Javadoc says so.
  • New test aFailingErrorHandlerDoesNotStopTheOthersEither.

The pattern notes for both patterns are updated, and so is the test count in the main README (78 → 80).

Checks

./mvnw verify passes on Java 21: 80 tests, 0 failures, warnings as errors, and the architecture rules hold.


Generated by Claude Code

CheckoutFacade now refunds the payment and releases the reservation when
shipping is unavailable, so a charged customer is never left without an
order. EventBus now contains an exception from its error handler, so the
remaining listeners still get the event. Each fix has a test, and the
pattern notes and test count are updated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hSD37YjondwaEohZyAWpg
@alejandrolunatech alejandrolunatech self-assigned this Oct 22, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T09:06:13.988730Z f6587ff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alejandrolunatech
alejandrolunatech merged commit a082d59 into main Oct 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants