Skip to content

Make EventStore::Event#data a pure Hash

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The following discussion from !169957 (merged) should be addressed:

  • @splattael started a discussion:

    Observation (non-blocking) I wonder if instead of calling to_h here and in consume_event above we should rather ensure that Event#data only contains a real Hash.

    Currently, it's possible to pass "Hash"-like data for example ActiveSupport::HashWithIndifferentAccess.

    ActiveSupport::HashWithIndifferentAccess.new.is_a?(Hash) # => true

    Event#validate_data! could either:

    • Fail if data is not a real Hash
    • OR convert ActiveSupport::HashWithIndifferentAccess to a Hash

    This would make the to_h calls deep in the subscription code unnecessary.

    WDYT @fabiopitino?

    /cc @bwill because of !145585 (merged)

Edited by 🤖 GitLab Bot 🤖