Re: [w3c/ServiceWorker] Should EventSource and WebSocket be exposed in service workers? (#947)

> Firefox opens the WebSocket connection and maintains it for only 30 seconds (+/-) ... before reaching this limit (?) if the user presses the F5 key or if window.location.reload() is released page refreshes and there is no connection loss, it is as if the count would recommence. If you reach/pass this limit, the connection is closed silently without sending a "close frame" ... some time later the server reports 1006 (CLOSE_ABNORMAL).
>
> In Firefox navigate between cached pages (within this "30-second" limit) it also produces the same ... the open connection on the previous page is closed silently without sending a "close frame".

I believe this is firefox implementing the idle timeout of the service worker.  If there is no function event waitUntil() holding the service worker alive it will be stopped to conserve system resources.  The idle timeout is restarted when another functional event (like FetchEvent) is dispatched to the service worker.

> In Chrome there is no time limit and browsing between different pages already cached does not end the connection.

Do you have devtools open while running this test?  At least at one point chrome did not timeout service workers while devtools were open.  Not sure if that is still the case or not.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/947#issuecomment-411410480

Received on Wednesday, 8 August 2018 13:45:47 UTC