setTimeout callback called before promise callback

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: Jake Archibald, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox40 affected, firefox41 affected, firefox42 unaffected, firefox43 unaffected)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36

Steps to reproduce:

http://jsbin.com/yokugu/edit?js,console


Actual results:

`setTimeout` is logged before `promise1`.


Expected results:

Microtasks (promise callbacks) should execute before additional tasks (setTimeout).

Firefox 39 did the right thing, but 40 appears to have regressed.

Updated

3 years ago
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM
Ever confirmed: true
Product: Firefox → Core

Comment 1

3 years ago
I tested this in nightly 43 and dev edition 42 and it does not reproduce any more.  It does seem to effect 40 and 41, though.
status-firefox40: --- → affected
status-firefox41: --- → affected
status-firefox42: --- → unaffected
status-firefox43: --- → unaffected
(Reporter)

Comment 2

3 years ago
Ah, really sorry, I could have sworn I saw it failing in nightly, but I think I've been staring at these tests too long. Happy for this to close.

Comment 3

3 years ago
Well, if we can find the bug that fixed this, maybe we could uplift it to beta 41 before the next merge.

Updated

3 years ago
Blocks: 1193394
(Reporter)

Comment 4

3 years ago
I ran:

mozregression --find-fix --bad-release 40 --arg="https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/"

…but it didn't give me a "bad" version. I guess I'm using it wrong, unless the bug somehow doesn't happen in nightlies, but hit the release.
Bug 1179909 fiddled with event loops and Promises, but that landed in Nightly 43 after 42 branched.
> Well, if we can find the bug that fixed this

I was going to guess bug 1162013, but that landed in 40...

Also, I can't reproduce this in 40 or 41 or 39, though at least in 39 I can describe how it _could_ happen (see bug 1162013).
The affected versions are long gone, closing.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.