New issue
Advanced search Search tips

Issue 851773 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jun 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ServiceWorkerFetchDispatcher isn't respecting waitUntil()

Project Member Reported by falken@chromium.org, Jun 12 2018

Issue description

The expected behavior is that if the SW does something like:

  e.waitUntil(p);
  e.respondWith(r);

Then the browser starts processing `r` but keeps the SW alive until `p` settles. In C++ this is handled by:

  r settles => Mojo OnResponse* is called => SWFD runs fetch_callback_.
  p settles => Mojo response to DispatchFetchEvent is called => SWFD calls version_->FinishRequest().

But it looks like SWFD is calling FinishRequest)() once an OnResponse* is called.

So it seems to me SWFD isn't waiting for waitUntil.
 

Comment 1 by falken@chromium.org, Jun 12 2018

Owner: leon....@intel.com
Status: Assigned (was: Available)
Leon: this could be a good bug for you to take. (haven't confirmed 100% but my code reading says there's something weird here)

Comment 2 by falken@chromium.org, Jun 12 2018

Hum we have a unit test ServiceWorkerURLRequestJobTest.EarlyResponse which is supposed to test this. Let me check more.
I think ServiceWorkerFetchDispatcher::OnFetchEventFinished() is called when p settles.

Comment 4 by falken@chromium.org, Jun 12 2018

Status: WontFix (was: Assigned)
Ahhh I've forgotten we have two request ids: one for the response and one for the event finish. This is WAI. Sorry for the noise!

Sign in to add a comment