View can't update state based to multiple events produced by a single command

Hi,

According to my observations: if an event sourced entity produces multiple events from a single command, the view consuming the events is able to update state based to only one of the produced events.

For example, if a single command produces events E1, E2 and E3 all the events will reach the view logic only in case they are all ignored (effects.ignore()). The first event where effects.updateState(E?) is called for will be the last event of the series (E1-E3) ending to the view logic. This means I am unable to process for example both E1 and E2 to a view if they are originating from the same command.

For example Create To-Do List -command could produce events:

  • To-Do List Created
  • To-Do List Item Added
  • To-Do List Item Added

I am unable to create a representation of the To-Do List to view side as if I process the first event effects.updateState(To-Do List Created) the two latter events would get ignored by the view logic.

Nope. My Bad. I removed enum from my view state and that fixed the problem. Now I believe somehow the use of enum caused a failure when UpdateEffect was processed by the system. Could not get a proper error message from the system.

That should work, we’ll look into it.