15

Sometimes, roughly every 2-3 months, WhatsApp Web (web.whatsapp.com), that I access through Chrome or Chromium, displays a green banner at the top of the left column:

Update available - Click to update Whatsapp

"Update available. Click to update WhatsApp"

Clicking triggers a page refresh, then WhatsApp operates normally (it doesn't require a new pairing with the device). Actually, it is operative while the banner is displayed too, i.e. before accepting the update, too.

This usually appears at the start of a session (right when I visit the page), but it has also happened mid-session.

I'm confused by this request: the page has already the permission to set (and, I believe, update) its cookies, and it doesn't run any additional software on my computer. I wouldn't think it needs to do anything client side. So what is it updating and why would it need my click?

10
  • 1
    Old question but still relevant and unanswered? I would love to understand this as well. I assume it needs reloading because it wants to update scripts and needs to refresh, but doesn't want to refresh by itself without user consent?
    – Gabriel S.
    Sep 23, 2019 at 14:19
  • 4
    Posting as a comment since I don’t have sufficient rep for an answer. Part 1/2 The WhatsApp web app is fully cached in your browser & uses a service worker to manage itself. Advantages of caching an app include and are not limited to reduced payload sizes & offline capabilities. So every refresh only downloads a small payload including the service worker since the application is already cached! Pretty neat huh? Aug 28, 2020 at 2:22
  • 3
    Part 2/2 A service worker can detect when the app is outdated and can trigger a message like the one you've mentioned. The reason not to automatically refresh is a UX decision I believe, because it would suck if the page decided to refresh itself while you were typing a message. Aug 28, 2020 at 2:22
  • 1
    Thanks! That's a useful answer! How come you can't post an answer? The webapps.stackexchange.com/help/privileges/create-posts priviledge comes at 1 rep, much earlier than the webapps.stackexchange.com/help/privileges/comment
    – Nicola Sap
    Aug 28, 2020 at 9:36
  • 1
    On the question being off-topic: although my question is about a decision made by the app developers – for which we may never know the full reason – I believe it could get a valuable question nonetheless. Note my two closing questions (in bold in the post): the what (whcih can be inspected) and the why would it need to (which talks about software engineering practices in general).
    – Nicola Sap
    May 3 at 12:54

1 Answer 1

3

WhatsApp uses a service worker that cache some scripts, but the browser see the necessary scripts update only loaded the the page, because, he search for code change in the service worker. For this, WhatsApp hint you about it. It could also reload the page after the service worker update, but it also want that the user view the update and decides when it's opportune to reload the page.

Not the answer you're looking for? Browse other questions tagged or ask your own question.