You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
What is the current behavior?
Currently when you use the effects module and you use the time travel debugger the effect is triggered when replaying. This can for instance cause http requests to trigger again. In turn this causes the state to differ between the first "recording" of the app state and after replaying since it calls the endpoint during each replay.
This is my client after clicking through the first time manually. I added a new item to my list called "Create feature request for NgRx". This makes a call to the server. The result is this:
If I then replay using the time travel debugger, I end up with this:
It is clear to see that it actually added the record again, mutating the state and possibly causing different behaviour between manually editing state and afterwards replaying it.
Expected behavior:
I would expect the triggered effects not to be invoked during replay with the time travel debugger. This keeps the clients state consistent during replays and prevents weird behaviour dependent on the side effect model (like an http request returning an error the second time an endpoint is invoked).
My request is to ignore effects when replaying and only replay downstream actions like a success or failure which don't mutate state outside of the application's context.
The text was updated successfully, but these errors were encountered:
rstraub
changed the title
Effects should not be triggered when using time travel debugger
RFC: Effects should not be triggered when using time travel debugger
May 13, 2018
To my knowledge this is not possible because it is not clear to the app where the actions come from. But you can "ignore" all new actions and state changes once #955 lands using "lock".
I'm submitting a...
What is the current behavior?
Currently when you use the effects module and you use the time travel debugger the effect is triggered when replaying. This can for instance cause http requests to trigger again. In turn this causes the state to differ between the first "recording" of the app state and after replaying since it calls the endpoint during each replay.
This is my client after clicking through the first time manually. I added a new item to my list called "Create feature request for NgRx". This makes a call to the server. The result is this:

If I then replay using the time travel debugger, I end up with this:

It is clear to see that it actually added the record again, mutating the state and possibly causing different behaviour between manually editing state and afterwards replaying it.
Expected behavior:
I would expect the triggered effects not to be invoked during replay with the time travel debugger. This keeps the clients state consistent during replays and prevents weird behaviour dependent on the side effect model (like an http request returning an error the second time an endpoint is invoked).
My request is to ignore effects when replaying and only replay downstream actions like a success or failure which don't mutate state outside of the application's context.
The text was updated successfully, but these errors were encountered: