WebSWServerConnection::startFetch() should never fail synchronously. If it does, it will confuse the NetworkResourceLoader. NetworkResourceLoader::serviceWorkerDidNotHandle() will get called *before* NetworkResourceLoader::m_serviceWorkerFetchTask has been sent, which means that we would not properly deal with redirects. Worse, the call site which creates the ServiceWorkerFetchTask would then null out m_networkLoad, which would silently cancel the load that WebSWServerConnection::startFetch() started synchronously.
<rdar://problem/57490508>
Created attachment 385654 [details] Patch
r=me
Comment on attachment 385654 [details] Patch Clearing flags on attachment: 385654 Committed r253528: <https://trac.webkit.org/changeset/253528>
All reviewed patches have been landed. Closing bug.
http/wpt/service-workers/postMessage-fetch-order.https.html fails consistently. The spec does not mandate the order between fetch and postMessage since these are different sources so we could update the test accordingly. An alternative would be to only delay the didNotHandle case, which would remove an unnecessary dispatch in the usual case.