Bug 311722
| Summary: | Digital Credentials: fix DOMException mapping for platform-cancelled and unknown errors in WKDigitalCredentialsPicker | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Marcos Caceres <marcosc> |
| Component: | WebKit API | Assignee: | Marcos Caceres <marcosc> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 268516 | ||
Marcos Caceres
In WKDigitalCredentialsPicker.mm handleNSError: method, two error mappings need to be updated to align with the Digital Credentials spec:
1. WKIdentityDocumentPresentmentErrorCancelled currently maps to AbortError. Since platform-level cancellation is distinct from user-initiated abort (via AbortSignal) and user-initiated cancel (via the chooser UI), it should fall through to OperationError instead. The spec reserves AbortError for the two user/caller-driven cases only.
2. The default/unknown case currently maps to UnknownError. Per the WebIDL spec, UnknownError is defined as "the operation failed for an unknown transient reason (e.g. out of memory)" -- that does not fit a platform error with an unrecognised code. OperationError ("the operation failed for an operation-specific reason") is the correct modern catch-all.
Changes needed in handleNSError::
- Remove the WKIdentityDocumentPresentmentErrorCancelled case (let it fall through to default)
- Change default case from ExceptionCode::UnknownError to ExceptionCode::OperationError
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/174308268>
Marcos Caceres
Spec change: https://github.com/w3c-fedid/digital-credentials/pull/419
Marcos Caceres
Pull request: https://github.com/WebKit/WebKit/pull/64152
EWS
Committed 315973@main (8085276859d0): <https://commits.webkit.org/315973@main>
Reviewed commits have been landed. Closing PR #64152 and removing active labels.