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
[observer] infinite loop in ChangeNotifier #19472
Comments
Added Area-Pkg, Pkg-Observe, Triaged labels. |
doubtful, since there is nothing global to coordinate on. Introducing a global coordination would probably make it difficult to implement ChangeNotifier (it's just an interface) and/or adversely affect performance. I'm open to ideas but it's not clear to me how to fix it. It is unfortunately like any other infinite loop in Dart, or infinite series of async operations. I find debugging infinite loops in Dartium to be super hard, since debug tools can't reliably cause the code to break, so definitely sympathize on that. I wonder if we could improve the tools or somehow improve this more globally in Dart, perhaps by having a debug Zone that breaks after so many async ops, or makes it easier to set a breakpoint, or something along those lines. Added PatchesWelcome label. |
it's actually a mixin ... what I meant by that is: it's intended to be usable as just an interface. |
Added this to the Later milestone. |
Added Polymer-P-2 label. |
Removed this from the Later milestone. |
Removed Polymer-P-2 label. |
Removed Polymer-Milestone-Later label. |
inclined to say this is not in the cards. but pull requests welcome @ https://github.com/dart-lang/observe Added NotPlanned label. |
This issue has been moved to dart-archive/observe#65. |
This issue was originally filed by @vicb
When using an Observable, there is a safeguard in dirtyCheckObservables() to make sure the code does not enter an infinite loop.
There is no such safeguard in the ChangeNotifier and it might lead to an infinite loop:
var list = new ObservableList();
var depList = new ObservableList();
list.changes.listen((records) {
depList.add('change');
});
depList.changes.listen((records) {
list.add('change');
});
Do you think it would be possible to implement such a safeguard for this code ?
The text was updated successfully, but these errors were encountered: