Skip to content
Compare
Choose a tag to compare

RubyEventStore

  • Add: position_in_stream(event_id, stream_name) API which returns the position of given event in stream [#1053]

  • Add: global_position(event_id) API which returns the global position of given event [#1053]

  • Change: Make it possible to load events that no longer have a class representation in code [#1065]

    Less frustrating experience for retrieving events that cannot be represented with a class in code:

    • someone has deleted their class
    • never was available in particular codebase accessing events (i.e. standalone event browser)

    Represented as as a generic RubyEventStore::Event with additional metadata.

  • Add: Check incorrect usage of expected_version: :any in RubyEventStore::InMemoryRepository and raise RubyEventStore::InMe…

Compare
Choose a tag to compare

From this release we require Ruby version to be at least 2.6 in all gems. Ruby 2.5 reached its end-of-life and stopped receiving security updates on last day of March 2021. [#1035]

RubyEventStore

  • Fix: RubyEventStore::Mappers::Transformation::DomainEvent transformation should never change passed event. [#1002, 3ba0549]

  • Fix: Custom event type resolver now plays well with pubsub. [#1034]

RailsEventStore

  • no changes

RailsEventStoreActiveRecord

  • Fix: Batched reads with bi-temporal queries would return duplicate events. [#1037, #1040]

    If you ever used event_store.read.as_at or event_store.read.as_of introduced in v2.1.0, this is an important update for you.

  • Remove: No longer needed pgcrypto Postgres extension dropped from initial mig…

Compare
Choose a tag to compare

⚠️ If you're somehow trying to migrate from RES 1.x to this version, please migrate to v2.0.0 first ⚠️

RubyEventStore

  • Remove: Deprecated methods from previous release are gone [#946]

  • Add: Record upcasting as a way to on-the-fly transform previous event versions into newer ones when reading [#836]

    Usage:

class Mapper < PipelineMapper
  def initialize(upcast_map: {})
    super(Pipeline.new(
      Transformation::Upcast.new(upcast_map),
    ))
  end
end

RubyEventStore::Client.new(
  mapper: Mapper.new(upcast_map: {
    'OldEventType' => lambda { |record|
      Record.new(
        event_type: 'NewEventType',
        data:        ...,
        metadata:    record.metadata,
        timestamp:   record.timestamp,
        valid_at:    record.
Compare
Choose a tag to compare

RubyEventStore

  • no changes

RailsEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • Fix: Add Ruby 3.0 compatibility [#962, #963]

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • no changes
Compare
Choose a tag to compare

RubyEventStore

  • no changes

RailsEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • Fix: Add Ruby 3.0 compatibility [#962, #963]

BoundedContext

  • no changes

RailsEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • no changes

RubyEventStore::ROM

  • no changes
Compare
Choose a tag to compare

TL;DR upgrading from 1.3.0

I'm running on defaults and can deploy changes with downtime needed for required schema migrations

This is the most common and the simplest scenario of configuration, as seen below:

Rails.configuration.to_prepare do
  Rails.configuration.event_store = RailsEventStore::Client.new
  ...
end

Bump version in Gemfile to 2.0.0:

gem 'rails_event_store', '~> 2.0.0'

Add required migrations and run them:

rails g rails_event_store_active_record:created_at_precision
rails g rails_event_store_active_record:add_valid_at
rails g rails_event_store_active_record:no_global_stream_entries

rails db:migrate

I have some custom components: mapper, event, dispatcher, scheduler, repository

Refer to custom components guide for detaile…

Compare
Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • Change: Warn about incorrect usage of Projection.from_stream and normalize argument of such [#796, #847, 5694783]

RailsEventStoreActiveRecord

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RubyEventStore::Browser

  • no changes

RubyEventStore::ROM

  • no changes
Compare
Choose a tag to compare

RailsEventStore

  • no changes

RubyEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RubyEventStore::Browser

  • Fix: Browser too strict on requiring correlation_id presence since v1.2.0 [#835, a9526a0]

RubyEventStore::ROM

  • no changes
Compare
Choose a tag to compare

RailsEventStore

  • Fix: RailsEventStore::CorrelatedHandlerdemanded presence of correlation_id in event metadata (since v1.2.0). This is an unwanted change when dealing with events scheduled on previous version [8e725fd]

RubyEventStore

  • no changes

RailsEventStoreActiveRecord

  • no changes

AggregateRoot

  • no changes

RailsEventStore::RSpec

  • no changes

BoundedContext

  • no changes

RubyEventStore::Browser

  • no changes

RubyEventStore::ROM

  • no changes
Compare
Choose a tag to compare

RubyEventStore

  • Change: Appending or publishing to stream now generates correlation_id in metadata when none such is already provided. [#832]

    Previously in case of missing correlation_id, second event in the chain had its value backfilled from causing event id. This was confusing at best. After this change, every event has correlation_id.

    Was:

    event A              -> event B              -> event C
      event_id:       A       event_id:       B       event_id:       C
      correlation_id: nil     correlation_id: A       correlation_id: A
      causation_id:   nil     causation_id:   A       causation_id:   B
    

    Is now:

    event A              -> event B              -> event C
     event_id:       A       event_id:       B       event_id:       C
     correla…