Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request/Issue] Capability to unregister service worker from within the app via url #565

Open
pedroCX486 opened this issue Jan 3, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@pedroCX486
Copy link

pedroCX486 commented Jan 3, 2023

  • Is your feature request related to a problem? Please describe.

Currently there is no way to unregister the service worker (or disable it entirely) for the PWA, which causes problems with situations like (some) updates not loading and instead loading the previous UI version (it will always load from cache first) and situations where Yacht is behind an gateway like Cloudflare Access, it will always load the app but ignore things like the Access Gateway cookie expiring, requiring a redirect to re-login. In this last situation the app loads and makes an infinite loop (especially on iOS, where deleting Site Data is currently broken on Chrome based browsers, it doesn't unregister the service worker), locking up the tab.

A great example of the issue for me is, I took yacht down and on MS Edge and Chrome (both iOS), I can still see the login screen and type on it instead of seeing the usual error from CloudFlare. And if you were already logged in, you can even see the dashboard homepage, but incapable of being interacted because of an infinite loop in the requests (why incessantly try again and again if there was an error? Asking the user to reload after, say 2 retries, is best.) that locks up the tab.

  • Describe the solution you'd like

An web endpoint like the Misskey project does, hostname.example/flush (live example here: http://misskey.cf/flush, page source is not obfuscated), where you can access at anytime without being authenticated (and isn't behind the service worker) that will unregister the service worker and clean localstorage/any cache it can programatically.

  • Describe alternatives you've considered

Removing service workers entirely for the app. It's somewhat unnecessary for this type of application.

  • Additional context

Have none at the moment.

@pedroCX486 pedroCX486 added the enhancement New feature or request label Jan 3, 2023
@pedroCX486 pedroCX486 changed the title [Feature Request] Capability to unregister service worker from within the app via url [Feature Request/Issue] Capability to unregister service worker from within the app via url Jan 3, 2023
@SelfhostedPro
Copy link
Owner

I actually have disabled PWA functionality in the devel image due to widespread caching issues. I’ll take a look at adding that functionality back in and utilizing this.

@pedroCX486
Copy link
Author

pedroCX486 commented Jan 3, 2023

@SelfhostedPro Thanks for the reply! In my case, since I started with a non-devel image, and later tried to switch, I was still having issues with the PWA persisting and not updating the local version. I should try starting from scratch with the devel image, since I had to fully reinstall the browsers on my phone to be even able to access the URL again through there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants