Hello again I’m back again with another post, this post is about the issue with the same starter template as issue 2 and 1 but this issue is actually kind of severe as logically speaking not being able to use the site from the app is a problem. To replicate this issue all you need is a modern day phone in my case a Samsung S22. Open the app that gets downloaded and turn off all wifi and boom all those changes that were supposed to save in cache for some reason arent saved anymore. Even those the service worker has it inserted to save and it works on older phones it would seem because I got it to work properly on the Google Pixel 2. I’m started to actually get annoyed at how many issues I have had to post on this forum. Wh0 as always did a great job helping on issue 2 but it kind of went full circle again, Now it’s kind of hard to record 2 different phones when you only have 2 phones so this time I can’t provide video evidence. I know this post will most likely not get answered because I mean you would need to have the same exact phone as me to replicate the error in order to poke around at the code of the starter but it’s really the best information that I can provide. Glitch :・゚✧
If this post gets deleted I’m canceling my glitch premium subscription. Might just do this everytime I post.
okay I think it’s because this part in the service worker
// Specify what we want added to the cache for offline use
self.addEventListener("install", (e) => {
e.waitUntil(
// Give the cache a name
caches.open("glitch-hello-installable-cache").then((cache) => {
// Cache the homepage and stylesheets - add any assets you want to cache!
return cache.addAll(["/", "/style.css", "/index.js"]);
})
);
});
only fills in the cache on the “install” event.
and that only happens once, unless you update the service worker file.
You could probably do some vite magic to update an unused version string or comment in the service worker which is a hash if all the other files or a timestamp or something, to ensure that it’s reinstalled each time you change something - or just manually change that each time you make a change
or even just a comment at the top of the file that you update manually each time you change something
It doesnt matter I just checked all the featured PWAs on the homepage and still found a bug/issue with each one of them I can’t even be bothered anymore