New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account for existing _forceLastValidStreamState when rebuilding #142
Account for existing _forceLastValidStreamState when rebuilding #142
Conversation
kuhnroyal
commented
Oct 5, 2022
- potential fix for StoreConnector.shouldUpdateModel and VmFactory.fromStore called with different state instances #89
There are 2 test failures in the persistence test but that has to be unrelated. |
Yes, the persistence code is correct, but the persistence tests that are failing because they depend on precise timing. I was hoping to think of a way to make them more stable, but maybe they need to be removed. |
Ideally we should first create a failing test that was fixed by this change. |
I agree but that needs to be a widget test. Will see what I can do. |
Yes, if the problem is in the |
I added a test case which fails without the change. I also needed to make one more change in the |
* currently converter parameter does not work with shouldUpdateModel
I added a test workflow, if you want to enable Github Actions. |
Additionally I found with my test that the |
We could an an assert or change the converter function parameter, both changes are breaking. |
What changes to the converter function do you recommend? |
lib/src/store_connector.dart
Outdated
@@ -378,6 +378,12 @@ class _StoreStreamListenerState<St, Model> // | |||
} | |||
|
|||
_computeLatestModel(); | |||
if (widget.shouldUpdateModel != null) { | |||
// The initial state has to be valid at this point. | |||
// This is need so that the first stream event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here. "This is needed"
Fixed the typo.
I would say, release the fix as a patch and change the parameter of the |
@kuhnroyal Your fix is published in version 17.0.1. Thank you! |