New issue
Advanced search Search tips

Issue 823697 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

fetch() abort in page should be reflected in Request in service worker

Project Member Reported by ricea@chromium.org, Mar 20 2018

Issue description

Creating a fetch in the page, and then asynchronously aborting it, should be reflected in fetchEvent.request.signal.

Something like (in page):

const controller = new AbortController();
const f = fetch('foo', { signal: controller.signal });
setTimeout(() => controller.abort(), 1000);

In service worker:

self.onfetch = fetchEvent => {
  fetchEvent.request.signal.onabort = () => console.log('aborted');
  ...
}

'aborted' should be logged after a second.

First thing to do is to write some tests.
 
Labels: -Type-Compat Hotlist-Interop Type-Bug

Comment 2 by oliverj...@gmail.com, Jan 18 (4 days ago)

Any updates on this? We went to quite a lot of effort to ensure our app cancels requests appropriately. Now we've added a service worker, we seemed to have lost all that benefit.

Comment 3 by ricea@chromium.org, Yesterday (28 hours ago)

#2 Thanks for letting us know. We were waiting for a re-architecture of ServiceWorkers to be complete. This is now mostly done, so we plan to move ahead with this in the next few months.

Sign in to add a comment