Skip to content

Releases: RailsEventStore/rails_event_store

v2.17.1

23 Jul 16:17
Compare
Choose a tag to compare

RubyEventStore

  • no changes

RailsEventStore

  • no changes

RubyEventStore::ActiveRecord

  • Fix: Revert lazy loading of ActiveRecord introduced in #1906 [c54cb7c]

AggregateRoot

  • no changes

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • no changes

v2.17.0

09 Jul 15:52
Compare
Choose a tag to compare

RubyEventStore

  • Remove: Ruby 3.1 testing and official support dropped — EOL

    This is in line with our Maintenance Policy.

  • Add: Allow to pass message broker to client as a dependency [#1850]

    RubyEventStore::Client.new(
      message_broker: RubyEventStore::Broker.new(...)
    end
  • Add: Allow to specify topic in RubyEventStore::Client#publish instead of relying only on the event type [#1860]

    Event type is still the default topic if none is provided.

  • Add: Allow to compose multiple brokers [#1905, 14e8436]

    In this composition, the first broker responding to given topic will publish the message.

    Multiple brokers can also be composed to respond to the same topic — for example if you want to retain local, in-process subscriptions while also communicating with external systems.

  • Deprecate: Passing subscriptions: and dispatcher: to RubyEventStore::Client has been deprecated [#1850]

    Use message_broker: argument. The existing code will continue working until next major release —  internally an instance of message broker will be configured, but deprecation warning will be shown.

    RubyEventStore::Client.new(
      message_broker: RubyEventStore::Broker.new(
        subscriptions: ( ),
        dispatcher: ( )
      )
    end
  • Deprecate: Broker without topic support is now deprecated [#1860]

    Existing, custom broker components will continue to work — deprecation message will be show. This API will break on next major release.

  • Experiment: Introduce batch mappers [#1893]

    You can either provide a dedicated batch mapper or an existing mapper will be composed into default RubyEventStore::Mappers::BatchMapper implementation. This is an experimental feature.

    Read more: https://blog.arkency.com/batch-mapper-in-railseventstore-how-initial-idea-evolved-into-experimental-feature/

RailsEventStore

  • Fix: Double instrumentation in RailsEventStore::JSONClient is no more [#1851]

  • Fix: ActiveJob classes with AsyncHandlerHelpers respond to perform_now(event) [#1904, #1786, #1334]

    With addition of prepend RailsEventStore::AsyncHandler into an ActiveJob event handler, one could implement a perform method that took an event as an argument instead of a raw, serialized job payload.

    However, until now, there was a disparity for jobs-as-event-handlers executed inline with  perform_now. This change restores this balance.

  • Remove: Ruby 3.1 testing and official support dropped — EOL

    This is in line with our Maintenance Policy.

  • Remove: Rails 7.0 testing and official support dropped — EOL

    This is in line with our Maintenance Policy.

  • Add: Allow to pass message broker to client as a dependency [#1850]

    RailsEventStore::Client.new(
      message_broker: RubyEventStore::Broker.new(...)
    end
  • Add: Allow to specify topic in RailsEventStore::Client#publish instead of relying only on the event type [#1860]

    Event type is still the default topic if none is provided.

  • Add: Allow to compose multiple brokers [#1905, 14e8436]

    In this composition, the first broker responding to given topic will publish the message.

    Multiple brokers can also be composed to respond to the same topic — for example if you want to retain local, in-process subscriptions while also communicating with external systems.

  • Deprecate: Passing subscriptions: and dispatcher: to RubyEventStore::Client has been deprecated [#1850]

    Use message_broker: argument. The existing code will continue working until next major release —  internally an instance of message broker will be configured, but deprecation warning will be shown.

    RailsEventStore::Client.new(
      message_broker: RubyEventStore::Broker.new(
        subscriptions: ( ),
        dispatcher: ( )
      )
    end
  • Deprecate: Broker without topic support is now deprecated [#1860]

    Existing, custom broker components will continue to work — deprecation message will be show. This API will break on next major release.

  • Experiment: Introduce batch mappers [#1893]

    You can either provide a dedicated batch mapper or an existing mapper will be composed into default RubyEventStore::Mappers::BatchMapper implementation. This is an experimental feature.

    Read more: https://blog.arkency.com/batch-mapper-in-railseventstore-how-initial-idea-evolved-into-experimental-feature/

RubyEventStore::ActiveRecord

  • Remove: Ruby 3.1 testing and official support dropped — EOL

    This is in line with our Maintenance Policy.

  • Remove: ActiveRecord 7.0 testing and official support dropped — EOL

    This is in line with our Maintenance Policy.

  • Fix: Delay loading ActiveRecord::Base for Rails [#1906]

    Read more:
    https://blog.arkency.com/i-do-not-blindly-trust-setting-things-in-new-framework-defaults-initializers-anymore/

  • Change: Prevent ActiveRecord from serializing event data and metadata after they have been already serialized by the RubyEventStore::ActiveRecord::EventRepository [#1876, 5c8a99b]

    This change affects only schemas with JSON/B colums. It simplifies confguration, documentation and harmonizes the behaviour with other column types and event repository implementations (InMemory, ROM, Sequel).

    In RubyEventStore, every event repository is responsible for serializing the payload for the storage. From now on this expectation is consistent for JSON/B data type as well, without requiring hacks with NULL serializer.

    When following JSON configuration guidance — this change is backwards compatible:

    •  if you have a JSONClient, the defaults have been changed and there's nothing more to do

    • if you have a schema with JSON/B columns and pass serializer: NULL to an instance of a RubyEventStore::ActiveRecord::EventRepository explicitly, a deprecation warning is emitted and a fallback is applied — you should be using serializer: JSON from now on

    Configuring RubyEventStore correctly for JSON was tricky in the past. Chances are some of you may have ended up with double data and metadata serialization unintentionally — first by the repository, second by the ORM 😔. On the surface it all looks good, but no one wants nor needs doing something twice unnecessarily. In such case this change will break that behaviour — for the good.

    How to detect if you're in this situation? Look at your raw data in event_store_events table.

    ::ActiveRecord::Base.connection
      .execute("SELECT data FROM event_store_events ORDER BY id DESC LIMIT 100")
      .map { |x| x["data"] }
      .any? { |x| x.match?(/^\"/) }
     => false # this is good
     SELECT data FROM event_store_events 
     WHERE pg_typeof(data) IN ('json', 'jsonb') AND starts_with(data::text, '"')
     ORDER BY id DESC 
     LIMIT 100;
    
     data
     ------
     (0 rows) # this is good

    What to do next when you're affected? Call rescue_from_double_json_serialization! on your RES client instance to patch readers on this instance.

    Rails.configuration.event_store.rescue_from_double_json_serialization!

    For the small price of 2% performance hit this will patch the read and perform additional deserialization when needed for the past, persisted events. New events will be already persisted and read without additional serialization. This will give you time — at some point you'll need to fix remaining database records before jumping on the next major (3.x) RubyEventStore release where this patch will no longer be available.

AggregateRoot

  • Remove: Ruby 3.1 testing and official support dropped — EOL

    This is in line with our Maintenance Policy.

  • Add: Allow to add event type resolver to be used in the apply strategy [#969]

    This open the door to use to event types that are not directly derived from event class name in AggregateRoot event handlers.

  • Deprecate: Including AggregateRoot.with_default_apply_strategy or AggregateRoot.with_strategy(...) modules is now deprecated [#969]

    Use this instead:

    include AggregateRoot
     include AggregateRoot.with(strategy: ...)
    ```...
Read more

v2.16.0

17 Mar 13:39
8dd4057
Compare
Choose a tag to compare

RubyEventStore

  • Fix: deprecation warning about ostruct not being a part of Ruby 3.5

  • Change: OpenStruct is handled by RubyEventStore::Mappers::Transformation::PreserveTypes only if the library is present in the project bundle

  • Add: Testing against and official support for Rails 8.0

  • Add: Testing against and official support for Ruby 3.4

  • Remove: Testing against Rails 6.0 and 6.1 and official support for this EOL releases

RailsEventStore

  • Add: Testing against and official support for Rails 8.0

  • Add: Testing against and official support for Ruby 3.4

  • Remove: Testing against Rails 6.0 and 6.1 and official support for this EOL releases

RubyEventStore::ActiveRecord

  • Add: Testing against and official support for Rails 8.0

  • Add: Testing against and official support for Ruby 3.4

  • Remove: Testing against Rails 6.0 and 6.1 and official support for this EOL releases

AggregateRoot

  • Add: Testing against and official support for Rails 8.0

  • Add: Testing against and official support for Ruby 3.4

  • Remove: Testing against Rails 6.0 and 6.1 and official support for this EOL releases

RubyEventStore::RSpec

  • Add: Testing against and official support for Rails 8.0

  • Add: Testing against and official support for Ruby 3.4

  • Remove: Testing against Rails 6.0 and 6.1 and official support for this EOL releases

RubyEventStore::Browser

  • Add: Testing against and official support for Rails 8.0

  • Add: Testing against and official support for Ruby 3.4

  • Remove: Testing against Rails 6.0 and 6.1 and official support for this EOL releases

v2.15.0

09 Aug 13:15
Compare
Choose a tag to compare

RubyEventStore

  • no changes

RailsEventStore

  • Fix: Template works with existing Rails 7.1 applications [046a59c, #1743]

RubyEventStore::ActiveRecord

  • Fix: Compatibility with strong_migrations [#1755]

AggregateRoot

  • Remove: Drop obsolete base64 gem dependency [#1738]

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • Add: Possibility to copy event id, payload or metadata to clipboard

  • Add: Search modal launched by Meta + K key shortcut

  • Add: Tooltips for current timezone — hovering over the created at or valid at fields displays selected timezone

  • Add: Favicon [#667]

  • Fix: Map IANA linked time zones to the canonical ones [7a13952, #1753]

  • Change: Pagination state is now kept in URL [#1742, #763]

  • Change: UI improvements

    show
    index

v2.14.0

29 Jan 14:49
Compare
Choose a tag to compare

RubyEventStore

  • no changes

RailsEventStore

  • no changes

RubyEventStore::ActiveRecord

  • no changes

AggregateRoot

  • no changes

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • Change: Several UX improvements for displaying events [#1726]

  • Change: Show timestamps in local timezone when browsing stream [#1723, #1727]

    Timezone is detected upon Browser start. There's still an ability to revert display to show timestamps in UTC, using select input in the footer.

    res_browser

v2.13.0

07 Dec 13:14
Compare
Choose a tag to compare

RubyEventStore

  • Change: RubyEventStore::BatchEnumerator optimization [#1708, #1711]

    Skip fetching the next batch if the previous one was smaller than the specified batch size.

RailsEventStore

  • no changes

RubyEventStore::ActiveRecord

  • Change: RubyEventStore::ActiveRecord::BatchEnumerator optimization [#1708, #1711]

    Skip fetching the next batch if the previous one was smaller than the specified batch size)

  • Change: N+1 optimization [#1708, #1710]

    Avoiding N+1 without additional query when join clause is used in the base read query.

AggregateRoot

  • no changes

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • no changes

v2.12.1

05 Sep 10:56
Compare
Choose a tag to compare

RubyEventStore

  • no changes

RailsEventStore

  • no changes

RubyEventStore::ActiveRecord

  • Fix: foreign key migration generators introduced in v2.12.0[459f443]

AggregateRoot

  • no changes

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • no changes

v2.12.0

04 Sep 15:36
e6a2706
Compare
Choose a tag to compare

RubyEventStore

  • Change: Calling Specification#from and Specification#to won't trigger SQL query to check if given event id exists [067e9b7]

  • Fix: Raise RubyEventStore::EventNotFound instead of NoMethodError if the event_id passed to Specification#from or Specification#to does not exist while using InMemoryRepository [#1673]

RailsEventStore

  • Add: Support ActiveJob::ConfiguredJob as a valid handler for ActiveJobScheduler [331c16b]

RubyEventStore::ActiveRecord

  • Add: Support for ActiveRecord PostGIS adapter in migration generators [#1650, #1668]

  • Add: Support for ActiveRecord Trilogy adapter in migration generators [#1671]

  • Add: Foreign keys for data consistency. This prevents manually removing events at database level if they are already linked in any stream [#1646]

    For existing Rails app installations use:

    bin/rails g rails_event_store_active_record:migration_for_foreign_key_on_event_id
    bin/rails db:migrate

    For non–Rails applications:

    bundle exec rake db:migrations:add_foreign_key_on_event_id
    bundle exec rake db:migrate

    New installations are no–op.

  • Fix: Raise RubyEventStore::EventNotFound instead of ActiveRecord::RecordNotFound if the event_id passed to Specification#from or Specification#to does not exist [#1673]

AggregateRoot

  • no changes

RubyEventStore::RSpec

  • Fix: Publish matcher works correctly with in_streams specifier [#1670, #1672]

RubyEventStore::Browser

  • no changes

v2.11.1

24 Jul 16:24
de7ba9c
Compare
Choose a tag to compare

RubyEventStore

  • no changes

RailsEventStore

  • no changes

RubyEventStore::ActiveRecord

  • no changes

AggregateRoot

  • no changes

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • Fix: Browser being unusable due to two–section only version number and two–digit number being a part of version number [0400187, #1647]

v2.11.0

20 Jul 08:42
10ce88e
Compare
Choose a tag to compare

RubyEventStore

  • Fix: Restoring original type with PreserveTypes won't break when stored data shape is different than original one. This change also allows using OpenStruct for data and metadata [3c5d928]

RailsEventStore

  • Add: Out of the box OpenStruct support in JSONClient [2bed49c]

RubyEventStore::ActiveRecord

  • no changes

AggregateRoot

  • no changes

RubyEventStore::RSpec

  • no changes

RubyEventStore::Browser

  • no changes