REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transp...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jun 2019 19:06:16 +0000 (19:06 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jun 2019 19:06:16 +0000 (19:06 +0000)
commit6ba1238d89c1e3ee56094b81f1954b48e74d0787
treec695c58049b66d1cc4e60d5f77bd731eea8ddfb2
parenta8061bf8e31ae0022c112a57b3d01daa1b3b77f0
REGRESSION (r245043) [Mac WK2 Debug] ASSERTION FAILED: m_services.isEmpty() && transports.size() <= maxTransportNumber seen with two http/wpt/webauthn/public-key-credential-* tests
https://bugs.webkit.org/show_bug.cgi?id=197917
<rdar://problem/51524958>

Reviewed by Brent Fulgham.

Source/WebKit:

This is a race condition that when a new request comes in the middle between the previous one finishes and the clearStateAsync is queued in the main thread.
Therefore, when the new request starts discovery, it will still see previous request's state.

To fix this issue, clearState() will be called unconditionally for every request. And a guard is added to clearState() to prevent double clearance.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::makeCredential):
(WebKit::AuthenticatorManager::getAssertion):
(WebKit::AuthenticatorManager::clearState):

LayoutTests:

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp