Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboarding fixes #632

Closed
shankari opened this issue Apr 17, 2021 · 43 comments
Closed

Onboarding fixes #632

shankari opened this issue Apr 17, 2021 · 43 comments

Comments

@shankari
Copy link
Contributor

  • allow users to choose when they want to be prompted
  • ask users whether they turn location services off manually when they are not traveling
    • if so, turn off geofencing
    • this requires a server fix around eaicf.filter_accuracy(uuid) that works on a person-by-person basis
@shankari
Copy link
Contributor Author

Fix crashes on android visible in Google Play.

@shankari
Copy link
Contributor Author

shankari commented Apr 22, 2021

Downgrade the iOS frequency from 1m to 5m, which is likely to be good enough, and will reduce data bloat.

@shankari
Copy link
Contributor Author

while modifying the pipeline, take a look at the reason why the pipeline is taking so much resources when it is not doing much. We can see a clear pattern of ~ 30-40% utilization around xx:05. There is a much smaller spike of ~ 3% at around XX:25, which should correspond to the pipeline for the staging site, except that the pipeline actually runs at XX:15.

I am not sure what, if anything, runs at XX:25 - the staging pipeline is done in 10 seconds.

2021-04-23T00:15:10.600539+00:00**********UUID b0c98c51-4bb9-4c67-9ec3-7814cfbdfc82: storing views to cache**********

@shankari
Copy link
Contributor Author

shankari commented Apr 23, 2021

I don't know why this was at XX:20 before, but it is now pretty consistently at XX:15. So:

  • the bumps are pretty clearly related to the pipeline runs, AND
  • the bump for the mini-pilot is clearly a lot bigger than the staging site

But why? There are more participants in the staging site, so the data processed in each round should be larger or about the same. The mini-pilot does have more overall data, but that shouldn't matter when we work only on a subset of the data on each run anyway.

@shankari
Copy link
Contributor Author

Looking at the database logs from #634,
we see that there are multiple "Slow query" logs from the database. They seem to happen primarily around XX:05.

There are similar entries in the stage database as well, around XX:15

{"t":{"$date":"2021-04-23T04:15:04.998+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn255","msg":"Slow query","attr":{"type":"command","ns":"Stage_database.Stage_timeseries","command":{"aggregate":"Stage_timeseries","pipeline":[{"$match":{"invalid":{"$exists":false},"user_id":{"$binary":{"base64":"redacted-A==","subType":"3"}},"$or":[{"metadata.key":"background/filtered_location"}],"metadata.write_ts":{"$lte":1619151299.8515463,"$gte":1619130027.220557}}},{"$group":{"_id":1,"n":{"$sum":1}}}],"cursor":{},"lsid":{"id":{"$uuid":"redacted-uuid-A"}},"$db":"Stage_database","$readPreference":{"mode":"primaryPreferred"}},"planSummary":"IXSCAN { user_id: \"hashed\" }","keysExamined":10546,"docsExamined":10546,"fromMultiPlanner":true,"cursorExhausted":true,"numYields":42,"nreturned":0,"queryHash":"2CD48019","planCacheKey":"04FE2BDF","reslen":120,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":44}},"Global":{"acquireCount":{"r":44}},"Database":{"acquireCount":{"r":44}},"Collection":{"acquireCount":{"r":44}},"Mutex":{"acquireCount":{"r":2}}},"storage":{},"protocol":"op_msg","durationMillis":144}}
{"t":{"$date":"2021-04-23T04:15:06.116+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn255","msg":"Slow query","attr":{"type":"command","ns":"Stage_database.Stage_timeseries","command":{"distinct":"Stage_timeseries","key":"metadata.key","query":{"user_id":{"$binary":{"base64":"redacted-B==","subType":"3"}}},"lsid":{"id":{"$uuid":"redacted-uuid-A"}},"$db":"Stage_database","$readPreference":{"mode":"primaryPreferred"}},"planSummary":"IXSCAN { user_id: \"hashed\" }","keysExamined":84333,"docsExamined":84333,"numYields":84,"queryHash":"608C4470","planCacheKey":"59115B15","reslen":459,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":85}},"Global":{"acquireCount":{"r":85}},"Database":{"acquireCount":{"r":85}},"Collection":{"acquireCount":{"r":85}},"Mutex":{"acquireCount":{"r":1}}},"storage":{},"protocol":"op_msg","durationMillis":297}}
{"t":{"$date":"2021-04-23T04:15:06.355+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn255","msg":"Slow query","attr":{"type":"command","ns":"Stage_database.Stage_timeseries","command":{"aggregate":"Stage_timeseries","pipeline":[{"$match":{"invalid":{"$exists":false},"user_id":{"$binary":{"base64":"redacted-B==","subType":"3"}},"$or":[{"metadata.key":"background/filtered_location"}],"metadata.write_ts":{"$lte":1619151301.1261685,"$gte":1618884020.167}}},{"$group":{"_id":1,"n":{"$sum":1}}}],"cursor":{},"lsid":{"id":{"$uuid":"redacted-uuid-A"}},"$db":"Stage_database","$readPreference":{"mode":"primaryPreferred"}},"planSummary":"IXSCAN { metadata.write_ts: -1 }","keysExamined":81082,"docsExamined":81082,"cursorExhausted":true,"numYields":81,"nreturned":0,"queryHash":"2CD48019","planCacheKey":"04FE2BDF","reslen":120,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":83}},"Global":{"acquireCount":{"r":83}},"Database":{"acquireCount":{"r":83}},"Collection":{"acquireCount":{"r":83}},"Mutex":{"acquireCount":{"r":2}}},"storage":{},"protocol":"op_msg","durationMillis":227}}
{"t":{"$date":"2021-04-23T04:15:06.612+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn255","msg":"Slow query","attr":{"type":"command","ns":"Stage_database.Stage_timeseries","command":{"find":"Stage_timeseries","filter":{"invalid":{"$exists":false},"user_id":{"$binary":{"base64":"redacted-B==","subType":"3"}},"$or":[{"metadata.key":"background/filtered_location"}],"metadata.write_ts":{"$lte":1619151301.1261685,"$gte":1618884020.167}},"sort":{"metadata.write_ts":1},"limit":250000,"lsid":{"id":{"$uuid":"redacted-uuid-A"}},"$db":"Stage_database","$readPreference":{"mode":"primaryPreferred"}},"planSummary":"IXSCAN { user_id: \"hashed\" }","keysExamined":84334,"docsExamined":84334,"hasSortStage":true,"cursorExhausted":true,"numYields":84,"nreturned":0,"queryHash":"DC3B42F3","planCacheKey":"7891DBE3","reslen":120,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":85}},"Global":{"acquireCount":{"r":85}},"Database":{"acquireCount":{"r":85}},"Collection":{"acquireCount":{"r":85}},"Mutex":{"acquireCount":{"r":1}}},"storage":{},"protocol":"op_msg","durationMillis":255}}
{"t":{"$date":"2021-04-23T04:15:06.814+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn252","msg":"Slow query","attr":{"type":"command","ns":"Stage_database.Stage_timeseries","command":{"distinct":"Stage_timeseries","key":"metadata.key","query":{"user_id":{"$binary":{"base64":"redacted-C==","subType":"3"}}},"lsid":{"id":{"$uuid":"redacted-uuid-B"}},"$db":"Stage_database","$readPreference":{"mode":"primaryPreferred"}},"planSummary":"IXSCAN { user_id: \"hashed\" }","keysExamined":115028,"docsExamined":115028,"numYields":115,"queryHash":"608C4470","planCacheKey":"59115B15","reslen":455,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":116}},"Global":{"acquireCount":{"r":116}},"Database":{"acquireCount":{"r":116}},"Collection":{"acquireCount":{"r":116}},"Mutex":{"acquireCount":{"r":1}}},"storage":{},"protocol":"op_msg","durationMillis":307}}
{"t":{"$date":"2021-04-23T04:15:07.110+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn252","msg":"Slow query","attr":{"type":"command","ns":"Stage_database.Stage_timeseries","command":{"find":"Stage_timeseries","filter":{"invalid":{"$exists":false},"user_id":{"$binary":{"base64":"redacted-C==","subType":"3"}},"$or":[{"metadata.key":"background/filtered_location"}],"metadata.write_ts":{"$lte":1619151301.8233714,"$gte":1619141951.179887}},"sort":{"metadata.write_ts":1},"limit":250000,"lsid":{"id":{"$uuid":"redacted-uuid-B"}},"$db":"Stage_database","$readPreference":{"mode":"primaryPreferred"}},"planSummary":"IXSCAN { user_id: \"hashed\" }","keysExamined":115029,"docsExamined":115029,"hasSortStage":true,"cursorExhausted":true,"numYields":115,"nreturned":0,"queryHash":"DC3B42F3","planCacheKey":"7891DBE3","reslen":120,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":116}},"Global":{"acquireCount":{"r":116}},"Database":{"acquireCount":{"r":116}},"Collection":{"acquireCount":{"r":116}},"Mutex":{"acquireCount":{"r":1}}},"storage":{},"protocol":"op_msg","durationMillis":276}}

@shankari
Copy link
Contributor Author

Note that, other than one query in the middle, all the slow queries use IXSCAN { user_id: \"hashed\" }". Is that a problem? Should I change the index on the scan?

@shankari
Copy link
Contributor Author

so the queries are: 2x aggregate, 2x distinct and 2x find.
I can fix the distinct pretty easily. but the find and aggregate are more tricky.

Both of them are for the background/filtered_location key and include a range for the write_ts so why are both of them slow?

Also, where the heck am I calling $aggregate from? I have a vague recollection of some kind of pipeline for the query, but I am not 100% sure where I wrote that.

@shankari
Copy link
Contributor Author

shankari commented Apr 23, 2021

Looking through the location where I access filtered_location, the most likely culprit seems to be the following which I added fairly recently

    def get_first_value_for_field(self, key, field, sort_order, time_query=None):
        """
        Currently used to get the max value of the location values so that we can send data
        that actually exists into the usercache. Is that too corner of a use case? Do we want to do
        this in some other way?
        :param key: the metadata key for the entries, used to identify the stream
        :param field: the field in the stream whose max value we want.
        :param time_query: the time range in which to search the stream
        :param sort_order: pymongo.ASCENDING or pymongon.DESCENDING
        It is assumed that the values for the field are sortable.
        :return: the max value for the field in the stream identified by key. -1 if there are no entries for the key.
        """
        result_it = self.get_timeseries_db(key).find(self._get_query([key], time_query),
                                                 {"_id": False, field: True}).sort(field, sort_order).limit(1)
        result_list = list(result_it)
        if len(result_list) == 0:
            return -1

        retVal = result_list[0]
        field_parts = field.split(".")
        for part in field_parts:
            retVal = retVal[part]
        return retVal

It doesn't directly have a reference to .aggregate or to the new metric.
I can try to remove it in the next round and see if the slow queries go away....

@shankari
Copy link
Contributor Author

But I sort the results for this query (as seen above). Where do I query for filtered_location as an aggregate without sorting? I am at a loss.

@shankari
Copy link
Contributor Author

ok so to avoid rabbit holing, I am going to focus on fixing the distinct queries for now and address the others later. Looking at the prepilot querie may also give us better clues.

@shankari
Copy link
Contributor Author

Looking at the prepilot queries, I see multiple entries for aggregate for different keys - e.g.

{"t":{"$date":"2021-04-22T21:11:46.078+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn85","msg":"Slow query","attr":{"type":"command","ns":"Stage_database.Stage_timeseries",
"command":{"aggregate":"Stage_timeseries","pipeline":[{"$match":{"invalid":{"$exists":false},"user_id":{"$binary":{"base64":"redacted","subType":"3"}},"$or":[{"metadata.key":"statemachine/transition"}],"data.ts":{"$lte":1614276055.766129,"$gte":1614120884.9993804}}},{"$group":{"_id":1,"n":{"$sum":1}}}],
"cursor":{},"lsid":{"id":{"$uuid":"redacted"}},
"$db":"Stage_database","$readPreference":{"mode":"primaryPreferred"}},
"planSummary":"IXSCAN { metadata.key: \"hashed\" }","keysExamined":77012,"docsExamined":77012,"fromMultiPlanner":true,"replanned":true,
"replanReason":"cached plan was less efficient than expected: expected trial execution to take 7040 works but it took at least 70400 works","cursorExhausted":true,"numYields":378,"nreturned":1,"queryHash":"DB79FCB6","planCacheKey":"5A5CFC70",
"reslen":144,"locks":{"ReplicationStateTransition":{"acquireCount":{"w":380}},"Global":{"acquireCount":{"r":380}},"Database":{"acquireCount":{"r":380}},"Collection":{"acquireCount":{"r":380}},"Mutex":{"acquireCount":{"r":2}}},"storage":{"data":{"bytesRead":69556396,"timeReadingMicros":26861}},"protocol":"op_msg","durationMillis":670}}

I am pretty sure that this is not an actual aggregate call that I make since I don't actually do anything fancy with statemachine transitions, for example. It is just that the query plan returns this. Looking at the actual plan, where we select values and then sum them, I suspect that this is from count_documents.

Although I looked for instances of count_documents and don't find any obviously related to statemachine/transition. But it is probably in some timeseries code. We can debug this further (if we wish) by adding comments to the queries, similar to
https://www.percona.com/blog/2017/06/21/tracing-mongodb-queries-to-code-with-cursor-comments/

@shankari
Copy link
Contributor Author

shankari commented May 28, 2021

@asiripanich as part of the onboarding improvements, I have the iOS settings page open now instead of the
location prompt for iOS13+. I have tested this in the emulator and it is fairly straightforward; however, I do not have a real device capable of running iOS 13+

Screen Recording 2021-05-27 at 11 08 15 PM mov

Would you be willing to install the new version using TestFlight and see if it is intuitive?
If so, please send me your AppleID via email and I can send you an invite.

@asiripanich
Copy link
Member

asiripanich commented May 28, 2021

Looks good! Will test and let you know.

On a somewhat related issue, has anyone complained to you that enabling the precise location option seems to consume significantly more battery than what it used to be a version earlier?

@shankari
Copy link
Contributor Author

shankari commented May 28, 2021

So the current onboarding flow is:

  • for iOS13+, we go to the settings page to enable location
  • user has to come back to the app manually (I can't figure out a way to bring an app to the foreground programatically)
  • if they have selected something other than "always", there is an alert sending them back
  • if they go back later and change to something other than "always", then if the app is in the background, it will get the notification and have the alert ready so they can re-enable on the next launch.

Is this too onerous? Should it be changed? If so, how?

@shankari
Copy link
Contributor Author

shankari commented May 28, 2021

would be great to do something similar for "Motion and Activity" settings.
https://stackoverflow.com/questions/21005990/ios-is-motion-activity-enabled-in-settings-privacy-motion-activity

We already do check for the motion activity permission and prompt the user to enable it. However, there doesn't appear to be a callback that we can easily hook into, similar to the location callback. Instead, we have to use the UserInfo in some way; need to figure out how.

Also, we only check the permission if the motion activity manager is enabled.

    if ([CMMotionActivityManager isActivityAvailable] == YES) {

When we first started the project, this was a primary concern, since there were still phone models (notably iPhone 5s) that did not have the M7 coprocessor. However, recently, we ran into a situation in which the user had an iPhone 6, but had their "Motion and Fitness" service turned off, which presumably returns false for if ([CMMotionActivityManager isActivityAvailable] == YES). Seems like we should also add a check for the manager being enabled but I can't figure out how to do that. CMMotionActivityManager.authorizationStatus() only returns whether the app has authorization.

We may need to check whether the phone is iPhone6+ and assume that CMMotionActivityManager isActivityAvailable being false means that the entire service is turned off.

@shankari
Copy link
Contributor Author

Unfortunately,
https://developer.apple.com/documentation/uikit/uidevice/1620044-model?language=objc

just returns

2021-05-28 10:30:38.968570-0700 CanBikeCO[41998:309900] current device model is iPhone
2021-05-28 10:30:45.774046-0700 CanBikeCO[41998:309900] current device model is iPhone

Maybe at some point we can stop assuming that people are using older model phones if we get to an iOS version that is high enough

@shankari
Copy link
Contributor Author

shankari commented May 28, 2021

Ah. From https://en.wikipedia.org/wiki/IPhone_5

The iPhone 5 supports iOS 6, 7, 8, 9 and 10.

We only currently support iOS 11+, so I think we can assume that if the activity is not available, then the service must be disabled.

Except on the simulator, where it is never enabled. Here's how we can check for simulator or not
https://stackoverflow.com/questions/458304/how-can-i-programmatically-determine-if-my-app-is-running-in-the-iphone-simulato

@shankari
Copy link
Contributor Author

One question: what should we do if kCLAuthorizationStatusNotDetermined? Right now, if it is not Always, we will prompt.
But if the user has not chosen anything yet, right after app install, is that too clunky? I don't think so, but would be good to hear from others.

@shankari
Copy link
Contributor Author

shankari commented May 29, 2021

So if the user does not have the Motion and Fitness settings service enabled, we need to open the "Privacy" settings. Unfortunately, there is no current way to open the Settings to anything other than the app page.
https://developer.apple.com/forums/thread/100471
https://developer.apple.com/forums/thread/65007?answerId=186656022#186656022
https://www.reddit.com/r/workflow/comments/6p9fbw/anyone_have_anything_on_url_schemes_in_ios_11/dkpvd7e

There’s no supported way to open Settings to the Wi-Fi ‘page’. The fact that this worked in iOS 9 is a bug that’s been fixed in iOS 10.

For future reference, the Apple URL schemes that are officially documented for third-party use include:

    Those listed in the Apple URL Scheme Reference

    UIApplicationOpenURLOptionsKey

    the specific case described in QA1924 Opening Keyboard Settings from a Keyboard Extension [This Q&A has been retired.]

Any Apple URL schemes that are not officially documented should be considered private API.

Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware 

Listed in the Apple URL scheme reference are the standard ones like tel: or sms:

@shankari
Copy link
Contributor Author

Refactoring the code significantly to centralize the checking in the TripDiarySettingsCheck class.
So instead of implementing the activity checking logic in markConsented, we now just call TripDiarySettingsCheck

@shankari
Copy link
Contributor Author

We don't make this change in the location onboarding because if location services is turned off, then the first call to location services seems to launch a prompt that goes directly to the location screen. Does this happen for motion activity as well?

@shankari
Copy link
Contributor Author

Actually, on a phone with the co-processor and the service turned off, CMMotionActivityManager isActivityAvailable is TRUE and CMMotionActivityManager authorizationStatus = 1

@shankari
Copy link
Contributor Author

Error codes

2021-05-29 11:33:56.430566-0700 CanBikeCO[16699:22004174] Error Error Domain=CMErrorDomain Code=105 "(null)" while reading activities, travel mode detection may be unavailable

@shankari
Copy link
Contributor Author

shankari commented May 29, 2021

Just to document the behavior:

  • if location services is turned off, but we try to access the location, we get a prompt asking us to turn on the location
  • if location services is on, but permission is off, we can open our app settings
  • if fitness service is off, but we try to access the activity manager, we get an error, no prompt
  • if fitness service is on, but permission is off, we can open our app settings

@shankari
Copy link
Contributor Author

The one place where this fails is if the location services are off, we are prompted, we turn them on, but don't change the permission. Don't get the prompt in that case.

@shankari
Copy link
Contributor Author

In that case, we first get a callback when the auth status is 2 (kCLAuthorizationStatusDenied). we check the service status, it is disabled

2021-05-29 16:17:22.652251-0700 CanBikeCO[43698:1409397] In didChangeAuthorizationStatus, new authorization status = 2, always = 3
2021-05-29 16:17:22.652329-0700 CanBikeCO[43698:1409397] DEBUG: In didChangeAuthorizationStatus, new authorization status = 2, always = 3
2021-05-29 16:17:22.653246-0700 CanBikeCO[43698:1409397] Calling TripDiarySettingsCheck from didChangeAuthorizationStatus to verify location service status and permission
2021-05-29 16:17:22.653328-0700 CanBikeCO[43698:1409397] DEBUG: Calling TripDiarySettingsCheck from didChangeAuthorizationStatus to verify location service status and permission
2021-05-29 16:17:22.654384-0700 CanBikeCO[43698:1409397] in checkLocationSettingsAndPermissions, locationService is not enabled
2021-05-29 16:17:22.654453-0700 CanBikeCO[43698:1409397] DEBUG: in checkLocationSettingsAndPermissions, locationService is not enabled

Then we get a callback with 0 (kCLAuthorizationStatusNotDetermined)

2021-05-29 16:17:38.509251-0700 CanBikeCO[43698:1409397] In didChangeAuthorizationStatus, new authorization status = 0, always = 3
2021-05-29 16:17:38.509566-0700 CanBikeCO[43698:1409397] DEBUG: In didChangeAuthorizationStatus, new authorization status = 0, always = 3
2021-05-29 16:17:38.513679-0700 CanBikeCO[43698:1409397] Calling TripDiarySettingsCheck from didChangeAuthorizationStatus to verify location service status and permission
2021-05-29 16:17:38.513808-0700 CanBikeCO[43698:1409397] DEBUG: Calling TripDiarySettingsCheck from didChangeAuthorizationStatus to verify location service status and permission
2021-05-29 16:17:38.574594-0700 CanBikeCO[43698:1409397] in checkLocationSettingsAndPermissions, locationService is enabled, but the permission is 0
2021-05-29 16:17:38.574697-0700 CanBikeCO[43698:1409397] DEBUG: in checkLocationSettingsAndPermissions, locationService is enabled, but the permission is 0
2021-05-29 16:17:38.576989-0700 CanBikeCO[43698:1409397] [Presentation] Attempt to present <UIAlertController: 0x7fd6c1018400> on <MainViewController: 0x7fd6e7c0a2a0> (from <MainViewController: 0x7fd6e7c0a2a0>) which is already presenting <UIAlertController: 0x7fd6e000ac00>.

So it looks like there is a problem because there is already an alert controller. Should not?? happen in a real phone?

@shankari
Copy link
Contributor Author

Ok, so we do get the permissions prompt on the second call this time, but when we open the app settings, there is no location prompt; presumably because we have never prompted for it.
This also happens in existing code (tested with emTripLog), so we would be fixing this as part of the change.

Does this also happen when we turn off location after the app install?
No, if we turn off location after the app install, the location is grayed out, and comes back to "Always" when we re-enable location.

The callback on enable is with kCLAuthorizationStatusNotDetermined

It is fixed the next time the app is killed and relaunched (e.g. as part of the diary init). But only if the user sees it :)

@shankari
Copy link
Contributor Author

so it seems like if we get a kCLAuthorizationStatusNotDetermined, we should prompt the user instead of (or maybe in addition to) doing it on init.

@asiripanich
Copy link
Member

asiripanich commented May 31, 2021

@asiripanich as part of the onboarding improvements, I have the iOS settings page open now instead of the
location prompt for iOS13+. I have tested this in the emulator and it is fairly straightforward; however, I do not have a real device capable of running iOS 13+

Screen Recording 2021-05-27 at 11 08 15 PM mov

Would you be willing to install the new version using TestFlight and see if it is intuitive?
If so, please send me your AppleID via email and I can send you an invite.

Just a reminder, @shankari I haven't received an invitation to test the app.

@shankari
Copy link
Contributor Author

@asiripanich can you check your spam folder?

Screen Shot 2021-05-30 at 6 25 09 PM

I just re-sent for the third time 😄

@asiripanich
Copy link
Member

My apologies! I can see them now.

@shankari
Copy link
Contributor Author

shankari commented May 31, 2021

@asiripanich one of the other users had their motion and fitness service turned off. So we didn't prompt for the permission and all their trips were "unknown". So I added in some additional fixes for that as well. Would be great if you would test with multiple combinations of

  • location services
  • location permission
  • motion and fitness service (Settings -> Privacy -> Motion and Fitness)
  • motion and fitness permission

All turned off and on at various times before, during and after the install. If things are turned off, you should get prompts to fix them and eventually you should get to the state where all the above are enabled/turned on.

@asiripanich
Copy link
Member

asiripanich commented May 31, 2021

at various times before, during and after the install. If things are turned off, you should get prompts to fix them and

Will test them out. Shouldn't you mention that the app needs "precise location"? tracking doesn't work on my rciti branch without the option on.

@shankari
Copy link
Contributor Author

@asiripanich points out that we should really check for the accuracy authorization as well.
That's a great point, and I tried to do it, but it is a bit complicated with the current code structure.
Concretely, the accuracy check is not a class method in CLLocationManager but an instance method on the loc manager.
And as we saw earlier, the periodic checks are launched from the remote push handling code, which does not have a reference to the loc manager object. Going to poke around this for 10 minutes, otherwise will defer the auto checks for the next set of changes.

@shankari
Copy link
Contributor Author

was able to work around it by accessing the loc manager singleton.
@asiripanich can you try out version 1.0.9? It has the additional text, but also has a programmatic check, and will prompt every hour if you have turned off precise location.

@shankari
Copy link
Contributor Author

shankari commented Jun 2, 2021

@asiripanich any updates on the testing? Would like to submit to the stores if possible.

@asiripanich
Copy link
Member

Testing now..

@asiripanich
Copy link
Member

asiripanich commented Jun 3, 2021

WIP

Off: Location service and Motion and Activity service

  • The location service menu popped up, but the other service did not.
  • So many things popped up at once, which was quite confusing.

Off: Motion and Activity service

  • The prompt that warns about the Motion and Activity service being off came up. But the 'Launch setting' botton did not take me to the correct settings page to turn on the Motion and Activity service.

Both on

  • No issue at all. Took me to the app settings page.

Disable precise location

  • A warning message came up with a 'Fix permission' button. When I refused to change and went back to the app the message went away.
  • Waiting to see if there will be a prompt.

@shankari
Copy link
Contributor Author

shankari commented Jun 3, 2021

for the motion and activity service, we can't open the settings page directly
#632 (comment)
and iOS will not pop it up directly like it does with location

@asiripanich
Copy link
Member

With a customised app, can't we bundle the latest version of the UI with the app? so users don't need to download when they first install the app?

@shankari
Copy link
Contributor Author

shankari commented Jun 7, 2021

Tracking new status screen in #644
Tracking VM crashes (seemingly related to dashboard) in #645

@shankari
Copy link
Contributor Author

shankari commented Jun 7, 2021

@asiripanich you can try out v1.0.9 (published Sunday) to see how the new version of the UI is bundled with the app. Make sure you to it soon, I will almost certainly push an app update at the end of June 😄

@shankari
Copy link
Contributor Author

This is superceded by the status screen changes in #680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants