Force version update when new features added on backend/web app
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.
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.
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.
Mentioned again by @anandwana001 - there are still older versions in the wild, so crash logs aren't as useful today.
- 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
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 to follow up on design details
@anandwana001 please document where the version number will be stored and the expected formatting of the version number.
@anandwana001 PR is ready - test is failing.