New issue
Advanced search Search tips

Issue 883475 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: Network.responseReceived is sometimes never dispatched

Project Member Reported by lushnikov@chromium.org, Sep 12

Issue description

Chrome Version       : 71

------------------------------------------
TL;DR: Network.responseReceived is sometimes never received, but both Network.requestWillBeSend and Newtork.loadingFinished are.
------------------------------------------

(Originally reported in puppeteer: https://github.com/GoogleChrome/puppeteer/issues/2888)

NOTE: This repro relies on a hosted website that might be taken down anytime; but that's the
only one I have).

1. Install puppeteer v1.7.0:

  $ npm install puppeteer@1.7.0

2. Use the following puppeteer script:

const puppeteer = require('puppeteer');

(async() => {
  const browser = await puppeteer.launch({headless: false, dumpio: true});
  const page = await browser.newPage();
  await page.goto("https://vault.rosx.technology");
  await page.click("header button");
  await page.waitForSelector('input[name="pf.username"]');
  await page.type('input[name="pf.username"]', "ertbnm+6pbwenc1esl3s@sharklasers.com");
  await page.click("#els-continue");
  await page.waitForSelector('input[name="password"]');
  await page.type('input[name="password"]', "123qwe");
  await page.click('button[type="submit"].els-primaryBtn', {delay: 1000});
  await page.waitForNavigation();
  await page.waitForSelector("h1");
  await browser.close();
})();


3. Run the script using protocol session output:

  $ DEBUG=*session node script.js

4. Notice the exception in node.js: "response is null". This happens because Network.responseReceived
event is never received for certain event, but both Network.requestWillBeSent and Network.loadingFinished are dispatched.



This happens because blink::InspectorNetworkAgent::DidReceiveResourceResponse is called *twice* for the
request in question, both times with empty resource:
- first time via blink::FrameFetchContext::DispatchDidReceiveResponse
- second time via blink::RawResource::ResponseReceived

As I figured from the DidReceiveResourceResponse, we don't dispatch empty responses (because why would we?).


=================================================

For the record, the two stack traces:

----------------------------------------------------------------------------------

0   libbase.dylib                       0x000000011680992c base::debug::StackTrace::StackTrace(unsigned long) + 28                                                                                              1   libblink_core.dylib                 0x000000011fc670fa blink::InspectorNetworkAgent::DidReceiveResourceResponse(unsigned long, blink::DocumentLoader*, blink::ResourceResponse const&, blink::Resource*) + 154                                                                                                                                                                                                              2   libblink_core.dylib                 0x000000011ffa1544 blink::probe::didReceiveResourceResponseImpl(blink::ExecutionContext*, unsigned long, blink::DocumentLoader*, blink::ResourceResponse const&, blink::Resource*) + 180                                                                                                                                                                                                3   libblink_core.dylib                 0x000000011fe7cb75 blink::FrameFetchContext::DispatchDidReceiveResponse(unsigned long, blink::ResourceResponse const&, network::mojom::RequestContextFrameType, blink::WebURLRequest::RequestContext, blink::Resource*, blink::FetchContext::ResourceResponseType) + 1413                                                                                                               4   libblink_platform.dylib             0x00000001223782e1 blink::ResourceLoader::DidReceiveResponse(blink::WebURLResponse const&, std::__1::unique_ptr<blink::WebDataConsumerHandle, std::__1::default_delete<blink::WebDataConsumerHandle> >) + 1569                                                                                                                                                                          5   libcontent.dylib                    0x0000000119c08c71 content::WebURLLoaderImpl::Context::OnReceivedResponse(network::ResourceResponseInfo const&) + 1217                                                  6   libcontent.dylib                    0x0000000119bf7ccb content::ResourceDispatcher::OnReceivedResponse(int, network::ResourceResponseHead const&) + 987                                                     7   libcontent.dylib                    0x00000001191a0bda content::ThrottlingURLLoader::OnReceiveResponse(network::ResourceResponseHead const&) + 618

----------------------------------------------------------------------------------

0   libbase.dylib                       0x000000011680992c base::debug::StackTrace::StackTrace(unsigned long) + 28                                                                                              1   libblink_core.dylib                 0x000000011fc670fa blink::InspectorNetworkAgent::DidReceiveResourceResponse(unsigned long, blink::DocumentLoader*, blink::ResourceResponse const&, blink::Resource*) + 154                                                                                                                                                                                                              2   libblink_core.dylib                 0x000000011ffa1544 blink::probe::didReceiveResourceResponseImpl(blink::ExecutionContext*, unsigned long, blink::DocumentLoader*, blink::ResourceResponse const&, blink::Resource*) + 180                                                                                                                                                                                                3   libblink_core.dylib                 0x000000011feb1e9c blink::ThreadableLoader::ResponseReceived(blink::Resource*, blink::ResourceResponse const&, std::__1::unique_ptr<blink::WebDataConsumerHandle, std::__1::default_delete<blink::WebDataConsumerHandle> >) + 252                                                                                                                                                       4   libblink_platform.dylib             0x0000000122356def blink::RawResource::ResponseReceived(blink::ResourceResponse const&, std::__1::unique_ptr<blink::WebDataConsumerHandle, std::__1::default_delete<blink::WebDataConsumerHandle> >) + 383                                                                                                                                                                              5   libblink_platform.dylib             0x0000000122378307 blink::ResourceLoader::DidReceiveResponse(blink::WebURLResponse const&, std::__1::unique_ptr<blink::WebDataConsumerHandle, std::__1::default_delete<blink::WebDataConsumerHandle> >) + 1607                                                                                                                                                                          6   libcontent.dylib                    0x0000000119c08c71 content::WebURLLoaderImpl::Context::OnReceivedResponse(network::ResourceResponseInfo const&) + 1217                                                  7   libcontent.dylib                    0x0000000119bf7ccb content::ResourceDispatcher::OnReceivedResponse(int, network::ResourceResponseHead const&) + 987                                                     8   libcontent.dylib                    0x00000001191a0bda content::ThrottlingURLLoader::OnReceiveResponse(network::ResourceResponseHead const&) + 618


 
Description: Show this description

Sign in to add a comment