[Webkit-unassigned] [Bug 202142] Fix ServiceWorker downloads

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 10 14:01:25 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=202142

--- Comment #17 from Jimmy Wärting <jimmy at warting.se> ---
(In reply to youenn fablet from comment #11)
> As long as the service worker has a client (page with the same origin), I
> think it is fine to keep the service worker running if it is fueling a
> download.
> 
> The problem is really when the service worker has no remaining client.
> If you close all evil.com pages as a user, the expectation is that no
> evil.com script is being run. If we keep running the service worker alone,
> this breaks this assumption.

I have had some ppl using my StreamSaver.js lib saying that they have experience some technical limitation. The download happens just like any other "normal" download dose in a background thread so they have thought, hey it must be okey to close this tab while i download this 20gb large file since it happens in the background - with no knowledge that a service worker or a main thread is feeding the stream with data.

I have given example/instruction on some best practices using onunload event to warn user from leaving.

so i would like to change your first statement to something like

As long as the service worker has stream fulling the hard drive with data and is not idle (paused for to long) and if the stream/pipeline isn't aborted or closed then i think it is fine to keep the service worker running. it would be awesome if you wasn't forced to stay on any page durning the hole time.

Otherwise this have some mixing UX behavior differences that may leave users  thinking that it's fine to close the page as it might happen in a background thread but really it isn't

---

little of topic here but... Honestly, I think this hole limited lifetime _almost_ completely stupid and not fully completely thought through, sure it had good intention but it's a pain in the but! 
There are good usecases too by having long lived service worker and developer have asked for it for a long time. I think everything could have been solved in any other "better" way.
see my comment on this mather: https://github.com/w3c/ServiceWorker/issues/980#issuecomment-486827233

Sure it's grate that you can kill un-needed or wasteful workers but if developers and user wants keep the worker alive for good reason's then let them make that decision, how? not sure there are some thoughts floating around in w3c/ServiceWorker#980

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210210/de18127d/attachment.htm>


More information about the webkit-unassigned mailing list