这是indexloc提供的服务,不要输入任何密码
Skip to content

mapAsync early-reject doesn't generate a validation error #4690

@kainino0x

Description

@kainino0x

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:

(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:

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.

Metadata

Metadata

Assignees

Labels

apiWebGPU APIneeds-cts-issueThis change requires tests (or would need tests if accepted), but may not have a CTS issue filed yetpotentially breakingCould require a breaking change to the API

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions