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

On device loss, should mapAsync throw AbortError instead of OperationError? #4774

@kainino0x

Description

@kainino0x

Currently, if the device is lost naturally (not destroyed), a pending mapAsync() promise will reject with OperationError.

If it is destroyed, it rejects with AbortError (destroying the device implicitly unmaps all buffers, which cancel pending maps with unmap(), which produces AbortError).

This is (1) kind of self-inconsistent and (2) inconsistent with our other usages of OperationError where I believe it always means there was some incorrect use of the API. This is not an incorrect use of the API.

It's unfortunately not easy to test because it relies on natural device loss (see #4177 which would fix this), and we haven't tried to test it. Chromium currently implements this incorrectly and rejects with AbortError in both cases.

I'm labeling this Milestone 0 and potentially breaking, though the chances that anyone is relying on this behavior seems extremely small.

EDIT: s/throw/reject/

Metadata

Metadata

Assignees

Labels

apiWebGPU APIapi resolvedResolved - waiting for a change to the API specificationneeds-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