ember.js: Ember.run.later sometimes does not execute callback on time

Hi,

I’m seeing something that looks like a race condition to me that sometimes stops run.later from working. More concretely: It looks like runs get stuck in the runloop, they aren’t executed after the specified time but only when something else starts a new runloop, for example if I click on something and the DOM changes or even more interesting, it’s even enough to put another Ember.run.later into the JS console: then it looks like a runloop is started again and the scheduled runs are processed.

This is the minimal example I could reproduce this with: http://emberjs.jsbin.com/siboromaho/1/edit I need to run it up to 80 times to trigger the behaviour … :-
When you see that some foo isn’t printed to the console you can press the “start runloop” button and it will get printed to the console immediately.

The next example is closer to what I’m doing in my app but it is also slightly more complicated, you don’t need to include the SomeView but if you do, it’s triggered way more often. http://emberjs.jsbin.com/xulibakupe/1/edit

The examples look a bit artificial but it’s what happens in my app through setting properties and observers. AFAICT I need the Promise in there and also the new Èmber.run.later in the then function, without it I can’t reproduce in my app even - or it just reduces the probability so far that if you remove it you hardly ever trigger it. FWIW I’m on Chromium 39

Best regards, Domme

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments