Skip to content

Possible bug in reading events direction #23

@paneq

Description

@paneq
2.4.1 :178 > client.read_events_forward(stream_name, 0, 20).first.position
 => 1 

2.4.1 :179 > client.read_all_events_forward(stream_name).first.position
 => 0 

2.4.1 :183 >   client.read_events_forward(stream_name, 0, 20)
 => [
#<struct Event type="ProductSupplied", data={"store_id"=>1, "sku"=>"WORKSHOP", "quantity"=>30}, source_event_uri="http://localhost:2113/streams/Product-1-WORKSHOP/1", event_id="91d2266a-bb8b-4e8a-9db0-0f15732cfecc", id=1, position=1, stream_name="Product-1-WORKSHOP", created_time=2017-09-11 12:54:59 UTC>, 
#<struct Event type="ProductRegistered", data={"store_id"=>1, "sku"=>"WORKSHOP"}, source_event_uri="http://localhost:2113/streams/Product-1-WORKSHOP/0", event_id="e059c1b1-5049-4b9c-8086-ebb1ec1f5239", id=0, position=0, stream_name="Product-1-WORKSHOP", created_time=2017-09-11 12:33:16 UTC>] 

2.4.1 :184 > client.read_all_events_forward(stream_name)
 => [
#<struct Event type="ProductRegistered", data={"store_id"=>1, "sku"=>"WORKSHOP"}, source_event_uri="http://localhost:2113/streams/Product-1-WORKSHOP/0", event_id="e059c1b1-5049-4b9c-8086-ebb1ec1f5239", id=0, position=0, stream_name="Product-1-WORKSHOP", created_time=2017-09-11 12:33:16 UTC>,
#<struct Event type="ProductSupplied", data={"store_id"=>1, "sku"=>"WORKSHOP", "quantity"=>30}, source_event_uri="http://localhost:2113/streams/Product-1-WORKSHOP/1", event_id="91d2266a-bb8b-4e8a-9db0-0f15732cfecc", id=1, position=1, stream_name="Product-1-WORKSHOP", created_time=2017-09-11 12:54:59 UTC>] 

Notice that read_events_forward returned events in different order than read_all_events_forward.

Is that intentional or a bug? I am not sure what to think about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions