LiquidProjections icon indicating copy to clipboard operation
LiquidProjections copied to clipboard

How should projectors handle hypothetical events which have null key?

Open IharBury opened this issue 9 years ago • 5 comments

Should projectors set up event map to:

  • Throw when an event has null key
  • Skip events with null key
  • Project all events with null key to a special projection with null key (current behavior for RavenDB but not possible for NHibernate) ?

IharBury avatar Oct 27 '16 12:10 IharBury

Maybe the EventMap should protect us from that, even before the projector is being called.

dennisdoomen avatar Oct 27 '16 18:10 dennisdoomen

Actually, after reading some documentation, the current behavior of RavenProjector is even more weird. When an event has null key, it will autogenerate a new key for the projection.

IharBury avatar Oct 28 '16 12:10 IharBury

Because that's what RavenDB does of course ;-)

dennisdoomen avatar Oct 28 '16 13:10 dennisdoomen

And how should a projector handle events where the aggregate id is not stored within the event itself, but only in an event envelope?

Corniel avatar Jan 23 '20 17:01 Corniel

And how should a projector handle events where the aggregate id is not stored within the event itself, but only in an event envelope?

The adapter between the specific event store implementation and Liquid Projections must make sure the aggregate ID is written to the Transaction.StreamId property. So the projector itself should not be aware of where the aggregate ID is coming from.

dennisdoomen avatar Jan 24 '20 06:01 dennisdoomen