Skip to content

simonracz/keepalive-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Possible Firefox bug in service workers

The code installs a service worker for a local download. It intercepts the fetch call and starts serving it via a ReadableStream. The download will fail after around 10 seconds, as the service worker gets terminated.

Usage

python3 -m http.server 8000

Updates

Update 1

According to this w3c spec communication, this is not a bug : w3c/ServiceWorker#882 (comment)

The official solution is to try to wrap long running operations up in a Promise and pass that to event.waitUntil. I found that hard to do without causing deadlocks in the sw in corner cases.

What I implemented is a PING message to the sw, to keep it alive while it's needed.

Chrome has the same "bug", however their time limit is 5 mins, that's why I didn't see it.

Update 2

Contrary to Update 1, this is assumed to be a bug.

Firefox : https://bugzilla.mozilla.org/show_bug.cgi?id=1302715

Chrome : https://bugs.chromium.org/p/chromium/issues/detail?id=678798

About

Possible Firefox bug in service-workers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published