Closed ckrey closed 2 years ago
A 200 with an empty body means that the regions did not change.
Done
We need a small change to this. We do not want uploads with region UNKNOWN anymore. Therefore, the region prompt form above is changed to this:
Furthermore, when the upload button is clicked and the region is UNKNOWN, this prompt will be shown to the user instead of triggering the upload.
And show this prompt to every user once after the update. Even if the user has already set a region.
Is it really the right direction where this is going?
It should be easily possible to identify the region from the trip location data. There should be no user input necessary and it could be done in the backend (even retrospectively for already received data).
The ongoing proposal uses current location, bothers the user (in some cases at app startup time, which is worst) and depends on app state ("Don't show again"). Apologies if this comes off as snarky, I don't mean it that way! I'm just curious: What are the points in favor of this design?
We can determine the region of each ride using the GPS information contained in that ride. But it gets complicated when a ride goes through multiple regions. In that case, it is up to the user to choose his/her region. Additionally, we cant determine the region of the profile file that is also uploaded with each ride upload. We need them for making statistical statements about our userbase.
Closing issues as it is already in production
The following prompt shall be shown to the user when the app is started if
A and ((B and C) or D)
istrue
A = The user has not pressed the "Don't show this again"-button before B = Last seen region ID is smaller than the new region ID from the backend C = The selected region is "UNKNOWN" or "other" D = The selected region is not among the top three nearest regionsIf "Don't show this again" is tapped on, the prompt is dismissed and does not appear again. If "Later" is tapped on, the prompt is dismissed but does appear again, if the above condition is met. If "Yes" is tapped on, the Profile menu opens and the focus is set to the region part.
Since we have over 70 regions now, finding the correct region in the dropdown menu can be exhausting. A switch in the Profile menu should switch between the dropdown and a button. By pressing the button, the 3 nearest regions are shown to the user and he can select one of them or cancel.
For this purpose, a new API endpoint was created:
<URL-to-backend>/12/check-regions?clientHash=<client-hash>&lastSeenRegionsID=<int>
Note that the backend version changed from 11 to 12.clientHash
is calculated like in the uploads.lastSeenRegionsID
is an integer of the last seen region file version.A succesful response is either a 200 with an empty body or a 200 with the folowing content:
... The last column
<Coordinates of the region>
is new. It contains a GPS location in form oflatitude,longitude
. Not every region/line has the last column. Those without shall not be considered when calculating the nearest region. For instance, the region "other" does not have the last column.A line beginning with a ! is still to be ignored. example:
The three nearest regions are calculated by comparing the current GPS location to the GPS locations from the regions file described above.