mrpmorris / Fluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.
MIT License
1.27k stars 146 forks source link

Deadlocks still occur #426

Closed mfmadsen closed 1 year ago

mfmadsen commented 1 year ago

Unfortunately there is still a deadlock issue in 5.8 if actions are dispatched on other threads while store activation is in progress. I'm currently working on a fix for this and will submit a PR when ready.

mfmadsen commented 1 year ago

@mrpmorris, I have made the change you can see here https://github.com/mrpmorris/Fluxor/compare/master...mfmadsen:Fluxor:fix-deadlockDuringStoreInitialize. I have added a unit test that reproduces the issue and then a small change in the Store to fix the issue. The change does mean that effects are processes as part of the dispatching pipeline one action after another. I do not believe this should cause any issues, but maybe you have some insights on why the effects previously was processed outside of the dispatcher queue processing?

mfmadsen commented 1 year ago

I have created PR #427

mrpmorris commented 1 year ago

Thanks very much for this, the test case was extremely useful.

Could you please alter the Store.cs changes to match the ones in this PR, and also update the releases.md file accordingly? https://github.com/mrpmorris/Fluxor/pull/430/files

Thank you!

I'd have just merged my own PR, but it seems to have eradicated acknowledgement of your contribution, and I didn't want that.