-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: location sharing without gms when not moving [WPB-9724] #3136
Conversation
Test Results855 tests 855 ✅ 13m 46s ⏱️ Results for commit 0789dc7. ♻️ This comment has been updated with latest results. |
APKs built during tests are available here. Scroll down to Artifacts! |
I just realized these tests, were not in 4.6. But they are on release/candidate and up, so just raising as probably they will be conflicts to RC and Develop 🙈 I think if you have, just prefer these changes over whatever we have nowadays. |
Quality Gate passedIssues Measures |
APKs built during tests are available here. Scroll down to Artifacts! |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Sometimes when we want to share the location on grapehene devices, the app is stuck on loading.
Causes (Optional)
On graphene there is no google services so the app uses the native manager to get the location, by requesting location updates. It works fine when the user is moving, but not when standing in the same place, probably because
requestLocationUpdates
emits items only when the location changes.Solutions
On newer Android versions use new way of getting location -
getCurrentLocation
and on old ones instead ofrequestLocationUpdates
, userequestSingleUpdate
because the app needs and uses only a single data anyway, doesn't need to listen for multiple changes.Also, to make it even faster and more user friendly, first the last known location is checked and if it's not too old (currently if it's not older than 1m) then just use this last location because it looks like the user hasn't moved since then.
If the last location is too old, then just request the current one. There is also a timeout of 10s to get the current location,
getCurrentLocation
has some timeout anyway, but it's not configurable and it's unclear how big it is, so to make it unified a custom one is created - if the new location doesn't appear within 10s, then user gets the info that the app couldn't get the location.Added tests for both
LocationPickerHelper
(to test getting location without google services on both new and old Android versions using robolectric) andLocationPickerHelperFlavor
(to test getting location with google services using mockk).Testing
Test Coverage (Optional)
How to Test
Open conversation screen and try to share location.
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.