PWA Issue 3 Another Samsung S22 Compatibility Issue

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.

If anyone knows how to update/upgrade VITE that would be a solution but hat might be locked behind glitch API.

documentation

wow, is that with no interaction after turning off data? you just close the notifications shade and the page is different?

maybe this has to do with the dev server from vite. could it be serving things with headers to prevent caching?

Don’t know what the issue is tbh was kind of banking you would know lol.

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.

well that sounds like a problem lol

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 :person_shrugging:
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

well said, if no one’s solved the problem for us, it’s hopeless

1 Like

guess so :person_shrugging:

edit 3 I cant tell if I fixed it or not lmao

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.