akvo / akvo-flow

A data collection and monitoring tool that works anywhere.
http://akvo.org/products/akvoflow/
GNU Affero General Public License v3.0
65 stars 31 forks source link

Missing app version number in Device list #1819

Closed janagombitova closed 7 years ago

janagombitova commented 7 years ago

Currently once a device connects for the 1st time with the dashboard we do not show the version info (app version) right away in the Devices list. Once the app is closed and re-opened again the version number is shown in the dashboard.

screen shot 2016-11-03 at 17 47 47

Many partners who manage the data collection check the version number to see which phones have updated to the new app and the version can be useful in support cases as well (if a fix has beed released in a particular version, but the user is still running a older version of the app). It would be more handy if the version number is shown consistently.

More research needed to understand in what cases the version number is shown and when not.

stellanl commented 7 years ago

I did a little digging into where this could happen.

The app starts 7 services

Unlike userId, the app version is always available in the app, so there should be nothing different between first and subsequent calls.

But which of the API calls result in changes to the Device list in the backend? /surveymanager?action=getAvailableSurveysDevice does /surveymanager?action=getSurveyHeader does /locationBeacon does /devicenotification updates all device db fields from the request except app version. This is the problem.

stellanl commented 7 years ago

While investigating this I also noticed that a second cause of the problem in #1731 is still around. The app DataSyncService also starts before deviceId is set, so it gets set to empty in the backend (for a while). See akvo/akvo-flow-mobile#484

stellanl commented 7 years ago

Test plan: Install app on a device. It should never show up in the list without an app version.

janagombitova commented 7 years ago

👍 Implementation works like a charm for both new devices and also old timer dinosaurs :)