marcglasberg / async_redux

Flutter Package: A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate. Allows for both sync and async reducers.
Other
234 stars 40 forks source link

before() swallows reducer() errors #105

Closed abijr closed 3 years ago

abijr commented 3 years ago

I expect for the error thrown in the reducer to get wrapped by the wrapError method regardless of the before override presence.

Full example derived from the main_before_and_after.dart example: https://gist.github.com/abijr/f33e93d9282b006fb1299b157152c9cf

If you comment the before override the error dialog appears. But if left uncommented, the reducer fails silently.

Additional notes:

Maybe I'm missing something.

Thanks for the awesome library!

abijr commented 3 years ago

Found a workaround.

If I dispatch the actions with the notify: false option, I can get my error dialogs to appear.

But it removes the effect of barrier type actions dispatched like this in the before method.

marcglasberg commented 3 years ago

This is fixed in version [13.0.0-dev0]:

https://pub.dev/packages/async_redux/versions/13.0.0-dev

Please read the Changelog:

https://pub.dev/packages/async_redux/versions/13.0.0-dev/changelog