fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.35k stars 343 forks source link

Offline mode interferences #1417

Closed davidoskky closed 1 year ago

davidoskky commented 1 year ago

Hello, I have Selfoss 2.19 installed on a remote server which I use from time to time, I don't remember ever activating offline mode but it could be. On my computer, I sometimes use a jupyter notebook; in the notebook console I repeatedly get this message over time:

404 GET /selfoss-sw-offline.js (127.0.0.1) 2.250000ms referer=None

The jupyter notebook is running on port 8888 and if I connect to localhost:8888 when the service is not running, I get the page

selfoss is still loading, please wait.

If I connect to other ports this does not happen. I have not installed selfoss locally, nor do I have any other local webserver.

jtojnar commented 1 year ago

That is really weird – we are just doing a standard ServiceWorker registration:

https://github.com/fossar/selfoss/blob/13871d7cadc4eb1860dd349f62457aa7c0780e43/assets/js/selfoss-base.js#L224

and since 2.19, we are only registering it if user explicitly enables offline mode:

https://github.com/fossar/selfoss/blob/3858ad45fb199a0fec2504b8ee63138ef13afa40/assets/js/selfoss-base.js#L90-L92

Maybe it is something from older version of selfoss that got stuck around?

Try manually unregistering it in about:serviceworkers (in Firefox) or chrome://serviceworker-internals/ (in Chromium).

davidoskky commented 1 year ago

Nevermind, I had a ServiceWorker registered on localhost:8888 for selfoss. I'm not really sure how it got there, but enabling offline mode now appears to correctly set the ServiceWorker to the domain where I have selfoss.