-
Notifications
You must be signed in to change notification settings - Fork 329
Description
Most error cases of mapAsync both reject the promise AND generate an error-scope validation error:
- If any of the following conditions are unsatisfied:
...
Then:
- Issue the map failure steps on contentTimeline.
- Generate a validation error.
- Return.
(I know we discussed this decision in depth at some point, but it was like this from the beginning so I'm not sure how to find the discussion. IIRC the main reason we kept it was that it was helpful for logging if errors from non-synchronous webgpu operations went there consistently. Anyway that's how the API works.)
However the early-reject case, which rejects if there's already a mapping pending, does not generate a validation error:
- If this.[[pending_map]] is not null:
The early-reject was added in #3348. Prior to that, IIUC this would have been a device-timeline error (the device-timeline-side state would have been "unavailable"), which would have generated a validation error.
We didn't think about this so this was definitely an oversight, not an intentional change in behavior. Implementing this requires injecting an error from the content timeline, but this should be not too hard for implementations to change.
It's also a minor breaking change. I'm not too worried about this though.