File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/webdriverio/src/utils/interception Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ export default class DevtoolsInterception extends Interception {
3737
3838 static handleRequestInterception ( client : CDPSession , mocks : Set < Interception > ) : ( event : Event ) => Promise < void | ClientResponse > {
3939 return async ( event ) => {
40+ // Race condition: if mock was already restored on client side
41+ // But browser managed to send "Fetch.requestPaused" event before it received "Fetch.disable"
42+ // Client-side "mocks" is already cleaned up, but browser is waiting for request instructions
43+ // In this case we have to send "Fetch.continueRequest" to browser and do nothing more
44+ if ( ! mocks ) {
45+ return client . send ( 'Fetch.continueRequest' , { requestId : event . requestId } ) . catch ( /* istanbul ignore next */ logFetchError )
46+ }
47+
4048 // responseHeaders and responseStatusCode are only present in Response stage
4149 // https://chromedevtools.github.io/devtools-protocol/tot/Fetch/#event-requestPaused
4250 const isRequest = ! event . responseHeaders && ! event . responseErrorReason
You can’t perform that action at this time.
0 commit comments