Skip to content
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

Closed
DartBot opened this issue Jun 16, 2014 · 10 comments
Closed

[observer] infinite loop in ChangeNotifier #19472

DartBot opened this issue Jun 16, 2014 · 10 comments
Labels
area-pkg closed-not-planned Closed as we don't intend to take action on the reported issue P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 16, 2014

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 ?

@kasperl
Copy link

kasperl commented Jun 17, 2014

Added Area-Pkg, Pkg-Observe, Triaged labels.

@jmesserly
Copy link

Do you think it would be possible to implement such a safeguard for this code ?

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.

@jmesserly
Copy link

(it's just an interface)

it's actually a mixin ... what I meant by that is: it's intended to be usable as just an interface.

@sigmundch
Copy link
Member

Added this to the Later milestone.
Removed Priority-Unassigned label.
Added Priority-Low label.

@sigmundch
Copy link
Member

Added Polymer-P-2 label.

@sigmundch
Copy link
Member

Removed this from the Later milestone.

@sigmundch
Copy link
Member

Removed Polymer-P-2 label.
Added Polymer-Milestone-Later label.

@sigmundch
Copy link
Member

Removed Polymer-Milestone-Later label.
Added PolymerMilestone-Later label.

@jmesserly
Copy link

inclined to say this is not in the cards. but pull requests welcome @­ https://github.com/dart-lang/observe


Added NotPlanned label.

@DartBot DartBot added Type-Enhancement P3 A lower priority bug or feature request area-pkg closed-not-planned Closed as we don't intend to take action on the reported issue labels Feb 3, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/observe#65.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg closed-not-planned Closed as we don't intend to take action on the reported issue P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants