EventStore / EventStore.UI

The user interface for Event Store
57 stars 37 forks source link

Debugging a projection does not update state #328

Open hayley-jean opened 2 years ago

hayley-jean commented 2 years ago

The state of the projection is not updated correctly when stepping through a projection to debug it. When running the projection normally without debugging, the state is updated as expected.

To reproduce:

  1. Create a projection with the following code:
fromStream("test-stream")
.when({
    $init: function(s) {
        return { count: 0 }
    },
    $any: function(s) {
        s.count++;
    }
})
  1. Open the debug screen for the projection
  2. Open the dev tools for your browser
  3. From another window/application, write an event
  4. Check that the event appears in the debug view on the left
  5. Click Run Step. The debugger in the dev tools will break just before the event handler code, and you can use the dev tools debugger to step through the handler.
  6. Step through the projection code until the event has been handled. The state is not updated.

EventStoreDB version: >= 21.10.2.