sitespeedio / chrome-har

Create HAR files from Chrome Debugging Protocol data
MIT License
148 stars 50 forks source link

Network.responseReceivedExtraInfo may be fired before or after responseReceived #120

Closed ifduyue closed 1 month ago

ifduyue commented 1 month ago

Fix issue #119

From https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-responseReceivedExtraInfo

responseReceivedExtraInfo may be fired before or after responseReceived.

Here is a reproduce https://gist.github.com/ifduyue/d850df87c1f58e4d1d4303e82e21e5fe

# inspect messages.json uploaded by me
# OR
git clone https://gist.github.com/d850df87c1f58e4d1d4303e82e21e5fe.git
cd d850df87c1f58e4d1d4303e82e21e5fe
npm i
node index.js
# and then inspect messages.json

Viewing the generated messages.json from this gist, we can observer that for "requestId": "98243.71", Network.responseReceivedExtraInfo was fired before responseReceived.

soulgalore commented 1 month ago

Hi @ifduyue thanks for the PR! Can you please run npm run lint:fix to fix your lint issues, then the tests can move on.

ifduyue commented 1 month ago

@soulgalore done

soulgalore commented 1 month ago

Thank you @ifduyue for your fix!