queue icon indicating copy to clipboard operation
queue copied to clipboard

Prompt users to reload page when application is updated

Open nwalters512 opened this issue 6 years ago • 1 comments

Noticed a nice feature that Repl.it has: it'll show a notification that "A new version is available; click here to reload". For a SPA where people might theoretically leave their tab open for a long time (and especially now that reloads aren't forced by auth so often), it would be valuable to have this for the queue.

Not totally sure how this would work - maybe we could embed the build time in the server-side code somehow? Or the git hash? Let's discuss how this might work

nwalters512 avatar Feb 14 '19 21:02 nwalters512

Service worker might be an approach. Since every byte difference in service worker source code is considered as an update, so you can embed a version number/git hash as part of the service worker source code and then go from there.

Potential Issue:

  1. For SPA, we might need to manually call the update method to trigger a check, but that's doable.
  2. Might need to figure out a way to manually update the service worker source code upon release, it's not ideal to do it by hand each time.

Related Link:

  • https://deanhume.com/displaying-a-new-version-available-progressive-web-app/
  • https://stackoverflow.com/questions/51748241/checking-for-service-worker-updates-in-a-single-page-app

zwang180 avatar Feb 15 '19 07:02 zwang180