Closed dalecurtis closed 1 year ago
Alternatively, we could invoke the error callback before rejecting pending flush promises.
Alternatively, we could invoke the error callback before rejecting pending flush promises.
I think that's what we should do
We generally tend to stay away from queuing micro tasks explicitly.
See discussion in https://github.com/web-platform-tests/interop/issues/382#issuecomment-1707164044 and https://github.com/web-platform-tests/interop/issues/382#issuecomment-1707195736, This would guarantee the flush promise to reject after the error callback is executed.
This turned out to be a bug in our implementation, so I don't think we need to change this after all.
Spec language for invoking the error callback says to "queue a task": https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task
Actually following this advice breaks some web platform tests. E.g., https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/webcodecs/audio-encoder.https.any.js;l=196;drc=004515931845095d994006bca1401c3bf94ecb68
It seems reasonable to expect the error callback to have been delivered after awaiting flush; so I think we want to change the language around invoking the error callback to "queue a microtask": https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-microtask
@padenot @youennf @Djuffin @aboba