Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Network requestWillBeSentExtraInfo and responseReceivedExtraInfo events #9738

Open
brendankenny opened this issue Sep 25, 2019 · 4 comments
Labels

Comments

@brendankenny
Copy link
Member

Network.requestWillBeSentExtraInfo
Network.responseReceivedExtraInfo

Added in July. From the change (https://chromium-review.googlesource.com/c/chromium/src/+/1592771), looks like it was to include updated information about blocked cookies and for better dealing with request information coming from outside of the renderer process. See also e.g. previous issues like puppeteer/puppeteer#487 (comment)

One real example already is my confusion in #9731 (comment) :)

Biggest pain adapting our current setup will be the event ordering, since "there is no guarantee whether requestWillBeSent or requestWillBeSentExtraInfo will be fired first for the same request" (and same for responseReceivedExtraInfo)

@brendankenny
Copy link
Member Author

brendankenny commented Sep 25, 2019

Biggest pain adapting our current setup will be the event ordering

and I guess how to resolve conflicting information. e.g. DevTools still shows a 200 status for me in #9731 (comment) even though the Network.responseReceivedExtraInfo brings in a later 304 status (so extra info might not always be intended to win?). @josepharhar might be able to help.

@josepharhar
Copy link

Ah yes I was wondering if lighthouse would be interested in the new events!

Reconciling the different events is complicated due to redirects and due to the fact that you can't know for sure if you will get ExtraInfo events because you don't know if a request will actually make it to the network stack, hence the exposure of that issue in the protocol events :(
I would recommend looking at my frontend patch for the events to see how to deal with redirects properly: https://chromium-review.googlesource.com/c/chromium/src/+/1639277

As for the status, the DevTools frontend only looks at the status number in Network.responseReceived to populate status code information. I suppose the status should be present in the first line of headersText in responseReceivedExtraInfo. I never knew there was an issue where the renderer (or InspectorNetworkAgent) thinks that the response code was different than what was actually received over the wire. If that's the case, it should definitely be a crbug.

@connorjclark
Copy link
Collaborator

this is certainly more correct. unclear what issues this incorrectness currently pose

@brendankenny
Copy link
Member Author

brendankenny commented Aug 31, 2022

at some point a redirectHasExtraInfo property was added to Network.requestWillBeSent and hasExtraInfo was added to Network.responseReceived, which seem like they could be very helpful to making handling of these easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants