Skip to content

Res 3.0 compatibility#465

Closed
tomaszpatrzek wants to merge 2 commits into
masterfrom
res-3.0-compatibility
Closed

Res 3.0 compatibility#465
tomaszpatrzek wants to merge 2 commits into
masterfrom
res-3.0-compatibility

Conversation

@tomaszpatrzek

Copy link
Copy Markdown
Collaborator

Make ecommerce compatible with RailsEventStore 3.0

RES 3.0 removes APIs that were deprecated in 2.x. This PR adapts ecommerce to
the upcoming release so it keeps working once the deprecated code is gone. Two
independent changes, one commit each.

  1. Drop removed ensure_supported_any_usage: keyword
    (infra/lib/infra/event_store.rb)

RubyEventStore::InMemoryRepository#initialize no longer accepts the
ensure_supported_any_usage: keyword in 3.0 — the "no mixing :any with a specific
expected position" rule is now enforced unconditionally. Passing the keyword
raised ArgumentError. We passed true, which is now the default, so simply
dropping it preserves behaviour.

  1. Replace apply_* handlers with the on DSL
    (domains/communication/lib/communication.rb)

RES 3.0 removed the apply_<event_name> state-handler naming convention; the
default apply strategy now raises AggregateRoot::MissingHandler for it. The
(empty) MessageSent / MessageRead handlers in Communication::Message were
switched to the on EventClass do … end DSL.

Compatibility

Both changes are backward-compatible with 2.x — the on DSL and omitting the
keyword both work on current RES, so this can be merged before 3.0 ships.

tomaszpatrzek and others added 2 commits June 22, 2026 13:32
RubyEventStore::InMemoryRepository#initialize no longer accepts the
ensure_supported_any_usage: keyword in 3.0 — the "no mixing :any with a
specific expected position" rule is now enforced unconditionally. Passing
the keyword raised ArgumentError. Dropping it preserves the previous
behaviour (we passed `true`, which is now the default).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RES 3.0 removed the apply_<event_name> state-handler naming convention;
the default apply strategy now raises AggregateRoot::MissingHandler for it.
Switch the (empty) MessageSent/MessageRead handlers to the `on` DSL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for ecommerce-events failed. Why did it fail? →

Name Link
🔨 Latest commit 9a6742a
🔍 Latest deploy log https://app.netlify.com/projects/ecommerce-events/deploys/6a3924ac1ffae400087dad28

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.

1 participant