fetch() abort in page should be reflected in Request in service worker |
|
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.
,
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.
,
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 |
|
Comment 1 by ricea@chromium.org
, Aug 2