Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bab1bc1f7610146c5ae0ad963cbcd3b743ab0a11
      
https://github.com/WebKit/WebKit/commit/bab1bc1f7610146c5ae0ad963cbcd3b743ab0a11
  Author: Marcos Caceres <[email protected]>
  Date:   2026-07-03 (Fri, 03 Jul 2026)

  Changed paths:
    M 
Source/WebKit/WebKitSwift/IdentityDocumentServices/WKIdentityDocumentPresentmentController.swift

  Log Message:
  -----------
  Digital Credentials: aborting navigator.credentials.get() can leave the 
document picker stuck on screen

rdar://180812397
https://bugs.webkit.org/show_bug.cgi?id=318013

Reviewed by Abrar Rahman Protyasha.

WKIdentityDocumentPresentmentController.cancelRequest() only cancelled
performRequestTask. When the abort arrived before the asynchronous
perform(request:) had assigned performRequestTask, the optional-chained
cancel was a no-op, so Identity Document Services was never told to dismiss
and the picker stayed on screen.

Track cancellation in an isCancelled flag set by cancelRequest().
perform(request:) throws without presenting when cancellation was already
requested; a cancel that arrives once the request is in flight is delivered
through performRequestTask as before. Map a CancellationError to .cancelled
so the request rejects with AbortError rather than UnknownError.

The controller is single-use: the picker creates a fresh instance per
request and discards it on dismiss, so isCancelled is terminal and never
reset. A hasStartedRequest guard makes that contract explicit, rejecting
reuse with requestInProgress rather than a stale cancelled state.

The repeated get()/abort path is exercised by the "Aborted Digital
Credentials get() requests do not leave a subsequent request stuck in an
invalid state" subtest in get-non-fully-active.https.html; a hermetic
regression test depends on the digital-credentials test automation in
bug 306292.

* 
Source/WebKit/WebKitSwift/IdentityDocumentServices/WKIdentityDocumentPresentmentController.swift:
(Base.perform(_:)): Throw before presenting if cancellation was already
requested, reject reuse of a single-use controller, and map a
CancellationError to a cancelled error.
(Base.cancelRequest): Record that cancellation was requested.

Canonical link: https://commits.webkit.org/316494@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to