You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm moving to use JSON as the serializer for our events, since JSON is far more universal outside of the Ruby world, but Metadata#[]= assumes keys will be Symbols, and raises an ArgumentError if not. This isn't the case with events that are dumped to and loaded from JSON. Here are a couple specs that demonstrate this:
let(:yaml_store)doRailsEventStore::Client.new(dispatcher: RailsEventStore::ActiveJobDispatcher.new(proxy_strategy: RailsEventStore::AsyncProxyStrategy::AfterCommit.new))endlet(:json_store)doRailsEventStore::Client.new(mapper: RubyEventStore::Mappers::Default.new(serializer: JSON),dispatcher: RailsEventStore::ActiveJobDispatcher.new(proxy_strategy: RailsEventStore::AsyncProxyStrategy::AfterCommit.new))endlet(:event){RailsEventStore::Event.new(data: {},metadata: {})}# fails, but should passit'publishes JSON-serialized events without error'doevent_store=json_storeevent_store.publisheventexpect(event_store).tohave_published(an_event(RailsEventStore::Event))end# passes as expectedit'publishes YAML-serialized events without error'doevent_store=yaml_storeevent_store.publisheventexpect(event_store).tohave_published(an_event(RailsEventStore::Event))end
The text was updated successfully, but these errors were encountered:
I'm moving to use JSON as the serializer for our events, since JSON is far more universal outside of the Ruby world, but
Metadata#[]=
assumes keys will be Symbols, and raises an ArgumentError if not. This isn't the case with events that are dumped to and loaded from JSON. Here are a couple specs that demonstrate this:The text was updated successfully, but these errors were encountered: