ground-android icon indicating copy to clipboard operation
ground-android copied to clipboard

Force version update when new features added on backend/web app

Open gino-m opened this issue 1 year ago • 7 comments

Suggested by @cdanielw - we may need to force data collectors to upgrade their app version when a survey is written with an incompatible newer version of the app, for ex when adding a new required task type as in #2469.

@kenstershiro @rawbzz for discussion.

gino-m avatar Sep 25 '24 15:09 gino-m

I guess we don't want to follow the normal pattern for force upgrades - forcing all app users to upgrade when a new release with a breaking change comes out - as it would create noise for folks who don't actually use that change. I've not seen examples where a force upgrade happens only if you perform some action, or only for targeted users, but keen to hear advice on what's possible.

kenstershiro avatar Oct 04 '24 11:10 kenstershiro

There hasn't been a real need for this yet, but I do think this will come up at some point.

Forcing upgrade on specific actions might be a bit harder to manage, since different versions might get triggered by different actions, leading to complexity and more chances to get things wrong. Perhaps the version upgrade request could per survey (i.e. surveys created with newer incompatible versions require upgrade?)

I'd suggest adding this mechanism for GA launch. We'd need to do a few things if we follow the per-survey model:

  • [ ] Add the web app version to the survey and jobs when writing them to the db.
  • [ ] No more partial updates to survey from the web app; the web app loads and rewrites the whole survey definition using the latest format on "Publish". (this may have already been done recently - @rfontanarosa to confirm)
  • [ ] The Android app knows which versions of the web app it's compatible with, and requests and upgrade when opening an incompatible survey.

Note that this only works for survey metadata, not for changes to LOIs, submissions, and how photos and offline imagery is stored. Open to suggestions.

gino-m avatar Oct 04 '24 14:10 gino-m

Mentioned again by @anandwana001 - there are still older versions in the wild, so crash logs aren't as useful today.

gino-m avatar Nov 04 '24 13:11 gino-m

  • Consider edge case of someone being offline for a long time
  • Min required version will be checked when offline, requiring update before usage
  • Req to avoid breaking surveys (all changes backwards compatible) still remains
  • This task should be for releasing fixes of breaking changes, not survey specific

kenstershiro avatar Nov 08 '24 15:11 kenstershiro

We discussed at today's PM/UX review. The accepted recommendation is to add a global min. app version to Firebase. When the app comes back online the user will be prompted to upgrade to the latest version to continue using the app.

Updated due to survey-level incompatibilities are out of scope and can be revisited in the future.

gino-m avatar Nov 08 '24 15:11 gino-m

@gino-m to follow up on design details

kenstershiro avatar May 14 '25 14:05 kenstershiro

@anandwana001 please document where the version number will be stored and the expected formatting of the version number.

kenstershiro avatar Jun 13 '25 14:06 kenstershiro

@anandwana001 PR is ready - test is failing.

gino-m avatar Jul 25 '25 14:07 gino-m