brianegan/flutter_redux

onDidChange called twice

TheCre8tor opened this issue · 8 comments

onDidChange called multiple times even though distinct is set to true,
and sometimes it works as expected.

I thought the issue was coming from my configuration or implementation
until I took full Javascript Redux course just to make sure I was
doing the right thing, and I was able to resolve the fact that the problem
wasn't coming from my end.

I saw a similar issue was opened on 28 Aug 2018,
and it hasn't been fixed till date. please can you help us look into it?

I'm also available if you need a hand on this project.

Alright, I will but I need to take permission from our CTO
before doing so. The application is a Fintech App and it
won't be nice if I just expose their code to anyone without
a permission to do so.

Thanks for the swift response.

No problemo! As a heads up, that might not be the best use of time, as that could take several hours for me to get up to speed with your codebase and then have to track down the issue. Is there any way you could create a separate / smaller sample application that demonstrates the issue or even better yet write a test case that demonstrates the issue? Furthermore, I just want to check that you have in fact implemented the == method on your "ViewModel" classes. Dart is not like JavaScript, in order for two objects to be equal, you need to write an equals method for each class. We cannot just loop through the keys in an object to make sure they're the same as another object, for example.

On Thu, Nov 25, 2021 at 10:47 AM Alexander Nitiola @.***> wrote: Alright, I will but I need to take permission from our CTO before doing so. The application is a Fintech App and it won't be nice if I just expose their code to anyone without a permission to do so. Thanks for the swift response. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#224 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA65DAPPR3HYBISXKCTCT3UNYA2RANCNFSM5IV2YHDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Alright, I'm going to create a small project that will demonstrate the bug.

I use Equatable package on all the classes.

Heya @TheCre8tor -- hope all is well. Did you happen to narrow this issue down to a test case or sample app that demonstrates the problem?

Thanks for checking up @brianegan, I have been sick, as soon I get on my feet,
I will create a simple app that demonstrates the the problem.

Hi,

I had the same problem here. It was due to my ignorance about how flutter works inside, especially about navigation. When I thought that the onWillChange called twice (or more), it was because I open many times the same widget with push navigation.
Check out with the devtools if you are not in the same case.