Duplicate Event IDs across streams causes odd behaviour

As per the subject, from the following commands:

  • Add Event ID “1” to Stream A = adds event to stream A
  • Add Event ID “1” to Stream A = nothing happens (idempotent)
  • Add Event ID “1” to Stream B = adds event to stream B (duplicate event from Stream A)
  • Add Event ID “1” to Stream B = adds event to stream B (duplicate event from Stream A and now a duplicate event in Stream B)
  • Add Event ID “1” to Stream A = nothing happens (still idempotent)
    This seems odd behaviour.

The above is achievable with the following commands:

curl -i [email protected]http://127.0.0.1:2113/streams/streamA” -H “Content-Type:application/json” -H “ES-EventType: SomeEvent” -H “ES-EventId: C322E299-CB73-4B47-97C5-5054F920746E”
curl -i [email protected]http://127.0.0.1:2113/streams/streamA” -H “Content-Type:application/json” -H “ES-EventType: SomeEvent” -H “ES-EventId: C322E299-CB73-4B47-97C5-5054F920746E”
curl -i [email protected]http://127.0.0.1:2113/streams/streamB” -H “Content-Type:application/json” -H “ES-EventType: SomeEvent” -H “ES-EventId: C322E299-CB73-4B47-97C5-5054F920746E”
curl -i [email protected]http://127.0.0.1:2113/streams/streamB” -H “Content-Type:application/json” -H “ES-EventType: SomeEvent” -H “ES-EventId: C322E299-CB73-4B47-97C5-5054F920746E”
curl -i [email protected]http://127.0.0.1:2113/streams/streamA” -H “Content-Type:application/json” -H “ES-EventType: SomeEvent” -H “ES-EventId: C322E299-CB73-4B47-97C5-5054F920746E”

Any advice?

Thanks,

Callum

Yes this is true.

Advice. Don't use the same event ids between multiple streams. An
event id identifies an event and is used for idempotency.