-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Async action reports to spy hundreds of times on each run #734
Comments
Ya this definitely needs to be fixed. I am currently running short on bandwidth. I am happy to take a PR if you can and review and help you over there. Let me know if we can collaborate to fix this over a PR. |
Thanks for quick response. I'll see if I have enough motivation to dig into this on the weekends :) |
is this in any roadmap to be fixed? |
Let's get a PR rolling. I can review and we can put in the fix. |
Here's the fix: #784 The issue was (the way I understand it) that the action zone's Nonetheless, I think it might be useful to have a (disabled by default) option to spy on these "continuations" as well. But in order to do that, a new kind of event has to be introduced, which must be traceable to the original action that triggered it. Since it looks like there's no easy way to achieve that right now, I'll just leave it as an idea for the future. |
is this related to #791 ? |
* Fix for #734 * Update async_action.dart * spy_test.dart: ensure that spy-event is raised only once for async actions that involve scheduleMicrotask * Updated changelog * Updated mobx version * Removed unneeded newline * Removed unneeded newline Co-authored-by: Pavan Podila <[email protected]>
* Fix for mobxjs#734 * Update async_action.dart * spy_test.dart: ensure that spy-event is raised only once for async actions that involve scheduleMicrotask * Updated changelog * Updated mobx version * Removed unneeded newline * Removed unneeded newline Co-authored-by: Pavan Podila <[email protected]>
* Fix for mobxjs#734 * Update async_action.dart * spy_test.dart: ensure that spy-event is raised only once for async actions that involve scheduleMicrotask * Updated changelog * Updated mobx version * Removed unneeded newline * Removed unneeded newline Co-authored-by: Pavan Podila <[email protected]>
Hi! We've added a spy for mobx so we can see in console what is happening with our stores. However it's not really usable for us because for some reasons async actions report to spy hundreds of times during a coarse of single action. I was able to reproduce this issue using HackerNews example from mobx tutorial.
To reproduce:
FutureObserver
:FeedItemsView
from news_widgets.dart to use onlylatestItems
from store for simplicity of example:flutter packages pub run build_runner watch --delete-conflicting-outputs
Expectation:
loadNews
action in HackerNewsStore runs only once and reports to spy about running once on Start and once on End.Reality:

loadNews
action in HackerNewsStore indeed runs only once (I can even test it by addingprint
statement inside async action) but reports to spy 450 (!) times about it's Start and EndUsing:
flutter_mobx: 2.0.3
mobx: 2.0.6
The text was updated successfully, but these errors were encountered: