StreamSaver.js icon indicating copy to clipboard operation
StreamSaver.js copied to clipboard

Service worker cuts out immediately when network connection is interrupted in FF

Open wcroachie opened this issue 1 year ago • 4 comments

EDIT - if anyone is interested, I created a much simpler library that essentially does the same thing StreamSaver does here: https://github.com/wcroachie/DiskWriterJS

I'm creating a system for zipping and downloading multiple large files over the course of a long period of time and wanted to make sure that the stream continues waiting idly if the network should cut out for a few minutes every now and then, and to resume downloading when the connection resumes. So I have been testing it by turning off my network connection for a few seconds and then back on again, and seeing whether the stream fails or not.

It seems to behave correctly in chrome, but in FF I get the following error:

Failed to load ‘’. A ServiceWorker intercepted the request and encountered an unexpected error.

Then, when the network connection resumes, I get the following error:

DOMException: The operation was aborted.

And this is after writer.write fails. In chrome, nothing happens, and the service worker continues to run fine when the network connection resumes. Anyways, is there a way of preventing the service worker from failing when the network temporarily cuts out in FF?

wcroachie avatar Mar 21 '24 15:03 wcroachie

Considering the same thing happens in your own library I assume this is a bug within Firefox?

llaurenss avatar Dec 06 '24 17:12 llaurenss