threema-ch / threema-web

The Threema Web application.
GNU Affero General Public License v3.0
1k stars 107 forks source link

WebUI does not check for new version #183

Closed dns2utf8 closed 7 years ago

dns2utf8 commented 7 years ago

Expected Behavior

The UI should warn the user from using an outdated version of the WUI.

Current Behavior

no_update_check

Possible Solution

Steps to Reproduce (for bugs)

  1. Use WUI, eg. 1.0.5
  2. Wait a bit until a new version gets deployed, eg. 1.1.0
  3. See the funny picture from current behavior

Your Environment

dbrgn commented 7 years ago

For all files loaded on a page reload, cache invalidation is being done.

The problem occurs when a user connected to the old version, then the new version is released, then an auto-reconnect happens. In that case, the new templates are loaded but the old code is still in place. If new template filters are being used, they don't exist in the code, therefore breaking some features. In 1.2.0 that would be displaying of files.

We need to do some kind of version check on load. If the version changed, show an alert with the information that a new version was released, and full-reload the page.

dns2utf8 commented 7 years ago

Does this mean, everytime I switch from one conversation to another it will download the same template again and check the version again?

dbrgn commented 7 years ago

It will download the version.txt file. The contents are about 5 bytes. I think that's reasonable.

ovalseven8 commented 5 years ago

Why is it necessary to send a request to the Threema server when I switch conversations? Would not it be enough to send it once and set a flag?

dbrgn commented 5 years ago

Some of the HTML parts (e.g. the conversation view) are loaded dynamically using AJAX. When clicking around the UI while an upgrade happens, if that upgrade contains HTML parts incompatible with the old version, then the UI may break. That's why we want to detect version updates as fast as possible. Using conversation switches is a good occasion for that.

ovalseven8 commented 5 years ago

It's probably nitpicky, but it feels not good that the web application sends a request for each conversation switch. It's some kind of activity tracking. Can you reconsider that decision?

rugk commented 5 years ago

Yeah, theoretically, an network attacker can see each time you switch a chat or so… (it's easy to detect these few bytes being sent)

I agree this may be a tracking problem. At least one can possible correlate things™…

dynamically using AJAX

Why not change that and make all loads instantly/no dynamic loading? If you think this takes too much time, IMHO, it can load all these when the session is setup/after scanning the QR code. You have a progress indicator anyway, there… :smile:

Or actually,it could theoretically do so while we are scanning the QR code, already, i.e. in the background, when the user is still fiddling around to get their phone out and scan the QR code. :wink:

lgrahl commented 5 years ago

Please open a new issue for that. We can use a service worker to pre-fetch all pages and then just check the version every once in a while.

ovalseven8 commented 5 years ago

=> #909