Bug 313735
| Summary: | Digital Credentials: user cancel should reject with NotAllowedError, not AbortError | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Marcos Caceres <marcosc> |
| Component: | WebCore Misc. | 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
When the user cancels the credential chooser (i.e., the platform returns an empty response), CredentialRequestCoordinator::handleDigitalCredentialsPickerResult() (line ~204) rejects with AbortError:
return dismissPickerAndSettle(Exception { ExceptionCode::AbortError, "User aborted the operation."_s });
Per the spec's "initiate the credential request" algorithm (step 3c at https://w3c-fedid.github.io/digital-credentials/#initiate-the-credential-request):
"If the user cancels the operation or no credential was selected:
Let error be a newly created "NotAllowedError" DOMException."
The error should be NotAllowedError, not AbortError. AbortError is reserved for AbortSignal-driven cancellation.
Fix: Change ExceptionCode::AbortError to ExceptionCode::NotAllowedError at the empty-response check in handleDigitalCredentialsPickerResult (or its renamed equivalent after bug naming alignment).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Marcos Caceres
<rdar://problem/174895437>
Marcos Caceres
Pull request: https://github.com/WebKit/WebKit/pull/64151
EWS
Committed 315895@main (7fafcac70285): <https://commits.webkit.org/315895@main>
Reviewed commits have been landed. Closing PR #64151 and removing active labels.