Skip to content

Commit

Permalink
[WebAuthn] Unable to submit new requests after cancelling conditional…
Browse files Browse the repository at this point in the history
… mediation via abortSignal

rdar://124727713
https://bugs.webkit.org/show_bug.cgi?id=271257

Reviewed by Charlie Wolfe.

In https://bugs.webkit.org/show_bug.cgi?id=257176, functionality was introduced to wait for a
previous request's cancel to complete before submitting a subsequent one. However, there's currently
a bug that does not set the cancel flag to false if there's no subsequent request.

This patch fixes that bug by setting m_isCancelling to false once the cancel completes regardless of
if there's a subsequent request.

* Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinator::create):
(WebCore::AuthenticatorCoordinator::discoverFromExternalSource):

Canonical link: https://commits.webkit.org/276368@main
  • Loading branch information
Pascoe committed Mar 19, 2024
1 parent d70154b commit 80b0cc5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,9 @@ void AuthenticatorCoordinator::create(const Document& document, CredentialCreati
weakThis->m_client->cancel([weakThis = WTFMove(weakThis)] () mutable {
if (!weakThis)
return;
if (auto queuedRequest = WTFMove(weakThis->m_queuedRequest)) {
weakThis->m_isCancelling = false;
weakThis->m_isCancelling = false;
if (auto queuedRequest = WTFMove(weakThis->m_queuedRequest))
queuedRequest();
}
});
});
}
Expand Down Expand Up @@ -289,10 +288,9 @@ void AuthenticatorCoordinator::discoverFromExternalSource(const Document& docume
weakThis->m_client->cancel([weakThis = WTFMove(weakThis)] () mutable {
if (!weakThis)
return;
if (auto queuedRequest = WTFMove(weakThis->m_queuedRequest)) {
weakThis->m_isCancelling = false;
weakThis->m_isCancelling = false;
if (auto queuedRequest = WTFMove(weakThis->m_queuedRequest))
queuedRequest();
}
});
});
}
Expand Down

0 comments on commit 80b0cc5

Please sign in to comment.