illinois / queue

A microservice queue for holding open office hours
University of Illinois/NCSA Open Source License
82 stars 36 forks source link

Prompt users to reload page when application is updated #210

Open nwalters512 opened 5 years ago

nwalters512 commented 5 years ago

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

zwang180 commented 5 years ago

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: