Response.body cancellation should be notified to the service worker |
||||
Issue descriptionReported at https://github.com/slightlyoff/ServiceWorker/issues/957. When a response with a ReadableStream is created on a service worker, cancelling reading from the response in the page should be notified to the underlying source in the service worker.
,
Aug 23 2016
I found it to be problematic to abort a download too. If you throw an error on the ReadableStream controller
> controller.error(new Error('Client aborted the download'))
then you are stuck with a pending download that can't be aborted or closed
,
Aug 23 2016
,
Aug 23 2016
> jimmy@warting.se I think the fetch request of download doesn't go to the service worker now. Issue 468227 Is your service worker handing the fetch request of download?
,
Aug 24 2016
> horo I'm actually not doing any fetch request, but i'm doing some fetch stuff in the SW. Here is my code: https://github.com/jimmywarting/StreamSaver.js/blob/18c31f8c0e4f5be9afdeedea0b665a7ce8d2e079/sw.js#L36
,
Aug 24 2016
Thank you for letting me know your script. Setting 'attachment' content-disposition can trigger downloads. I forgot about it.
,
May 3 2018
,
May 7 2018
#7 Your attachment is empty. What did you intend to upload?
,
Sep 11
We also have a problem with this issue. Our Application triggers a download with a fetch request to the ServiceWorker and respond with a ReadableStream and header "content-disposition attachment". Inside the Reader we fetch encrypted chunks from a server, decrypt them and write the data to the stream. It works pretty good, but if the user cancels the download we have no possibility to stop fetching the encrypted chunks. My expectations is, that if the user is cancelling the download, the ReadableStream should receive the cancel event. At the moment our issue is the same like in Comment 1. Sorry for my rusty english ;) Greeting Hendrik
,
Oct 16
,
Oct 22
|
||||
►
Sign in to add a comment |
||||
Comment 1 by pie...@gmail.com
, Aug 17 2016