element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
GNU Affero General Public License v3.0
3.36k stars 713 forks source link

Element Android configuration file #2180

Open bmarty opened 4 years ago

bmarty commented 4 years ago

We need a way to propose internal upgrade of the application. We often have users who report bug from old version, and also it can be a way to show the new things.

A popup will be displayed, blocking if current application is late regarding mandatory section, and not blocking in other cases. Two possible actions: "upgrade", which open the store and "later" which dismiss the popup, only in case of non mandatory upgrade.

Element Web

image

Host config file

Host a configuration file in https://element.io/mobile/im.vector.app.json (see with Ops what could be the most appropriate place. Ideally the mobile team could be able to edit this static file a few days after each release).

Content

This file should content the most recent version of the app, and if the update is recommended, or mandatory.

Also a dedicated section in the file (or a dedicvated file?) for F-Droid should be created.

Maybe add more section, on per applicationId, for the day we will manage several application Id.

So for instance we could have:

{
   "gplay":{
      "minimumClientVersion":{
         "mandatory":{
            "minVersionCode":4010006,
            "minVersionName":"1.0.6",
            "message":{
               "default":"A new version is available, please update your application",
               "fr":"Une nouvelle version est disponible, veuillez mettre à jour votre application"
            },
            "allowOpeningApp":false
         },
         "info":{
            "minVersionCode":4010008,
            "minVersionName":"1.0.8",
            "message":{
               "default":"A new version is available!",
               "fr":"Une nouvelle version est disponible!"
            },
            "changelogUrl":"https://github.com/vector-im/element-android/releases/tag/v1.0.8",
            "displayOnlyOnce":true,
            "allowOpeningApp":true
         }
      }
   },
   "fdroid":{
      "minimumClientVersion":{
         "mandatory":{
            "minVersionCode":4010006,
            "minVersionName":"1.0.6",
            "message":{
               "default":"A new version is available, please update your application",
               "fr":"Une nouvelle version est disponible, veuillez mettre à jour votre application"
            },
            "allowOpeningApp":false
         },
         "info":{
            "minVersionCode":4010008,
            "minVersionName":"1.0.8",
            "message":{
               "default":"A new version is available!",
               "fr":"Une nouvelle version est disponible!"
            },
            "changelogUrl":"https://github.com/vector-im/element-android/releases/tag/v1.0.8",
            "displayOnlyOnce":true,
            "allowOpeningApp":true
         }
      }
   }
}

Every fields are optional, but in some case it will be useless.

Version code does not include the arch digit. App should take that into account.

Implementation

The file will be downloaded using the RawService, with a 24 hours cache duration.

Ref

We can get inspired by what have been implemented for Tchap (see https://github.com/dinsic-pim/tchap-android/pull/554)

TR-SLimey commented 4 years ago

Personally, I don't think mandatory upgrade is a great idea. For one, business environments which are by now well known for using outdated software, will probably complain. Not that they're right, but this should definitely be considered IMO, as they are one of Element's biggest target markets. On top of this, as bad as it is, outdated homeservers are a thing, so the user may have no choice but to use an outdated client, which, if this gets implemented, will no longer work. Also, the config file as a whole could in a way be seen as the app "phoning home", which is definitely a bad sign for an app which is supposed to respect user privacy. I propose for the config to instead reside within /.well-known/_matrix/client on the homeserver, for example in a section like m.element-android. This is, IMO, much better for both privacy and compatibility with the homeserver. On top of this, I don't think there should be a way to force the user to upgrade, but rather, the admin should be able to mark updates as normal, important or critical, to alert the user, but never force them.