-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: Use local Onyx key to throttle location permission prompts. #48237
fix: Use local Onyx key to throttle location permission prompts. #48237
Conversation
Signed-off-by: krishna2323 <[email protected]>
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Will provide update today. |
@Julesssss @shubham1206agra, sorry for delay, I'm not sure what should we do with the permission prompt on the scan request page. I'm confused because if we don't get the current location using getCurrentPosition when the modal prompt has already been shown, we won't get the location even if the user has allowed location access. In my opinion (IMO), we shouldn't do anything for this page because if the user has denied it, the prompt will not be shown again afterward. |
Sorry @Krishna2323, I don't follow you. Can you elaborate the comment? |
@shubham1206agra, when we create a scan request through Quick action, the confirmation step is skipped, and we directly call In this case, we shouldn't hide the prompt if the confirmation page prompt has already been shown. This is because if we don’t call
|
If the permission is denied by the user in the modal, then we skip showing the modal for a week, no matter where it was about to show. |
I think I understand. So because of the simpler flow we don't show our custom permission prompt before the native permission is requested?
I think this is a bit confusing because we have both the custom prompt, and the native prompt. If we have already shown the custom prompt, and users accepted, we wouldn't need to show it again anyway, right? |
Yes, if the location access was granted or denied, the native prompt won't be shown again, it will just give the cords and proceed. |
So are we not able to stop calling |
I think we can. I will try to understand the flow better and respond here soon. |
@Julesssss @shubham1206agra, sorry for the delay 🙏🏻. I've been sick for the last three days 🤧. Let's try to understand the flow better: Scenario 1 - Location permission is unset (neither denied nor allowed)
Scenario 2 - Location permission is unset (neither denied nor allowed)
Scenario 3 - Location permission is unset (neither denied nor allowed)
IMO, what we have now (above scenarios) is the correct, but let me know if you think otherwise. Result with current implementation (Changes in this PR)geolocation_permission_flow.1.mp4 |
Thank you for the detailed notes. It's a bit of an edge case given that users must select yes to our prompt, but once to the iOS prompt (and only occurs on iOS). However, it does suck that our quick flow is blocked by the annoying iOS prompt. @shubham1206agra if it was possible to disable the check entirely for the quick action iOS flow with a unique param, I think that would be preferable. I'm going to share this for additional thoughts in the issue. Alternatively, do we get a response from the iOS permission (getLocation) request? Are we able to detect the users choice? If we could detect users who have selected 'Only Once' that would be ideal, but I fear this is going to be unlikely. |
@Krishna2323 Please see above comment. |
Ah yes sorry, I meant to tag you @Krishna2323 -- I looked at reviewers 🤦 |
Hey @Krishna2323. let's move forward with the known iOS issue where the prompt occurs in the quick action flow 👍 |
I think we can move forward with the current changes then, I will update the checklist tomorrow. |
Signed-off-by: krishna2323 <[email protected]>
@shubham1206agra, you can start reviewing this. |
Signed-off-by: krishna2323 <[email protected]>
Thanks for pointing out the bug, @shubham1206agra. You meant to say that if we set the Onyx key to not show the permission modal on App/src/pages/iou/request/step/IOURequestStepConfirmation.tsx Lines 497 to 498 in 4c9a3fb
|
@shubham1206agra friendly bump. |
@shubham1206agra, bump ^ |
@Krishna2323 Please resolve conflicts |
done. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeScreen.Recording.2024-10-03.at.4.40.35.PM.moviOS: NativeScreen.Recording.2024-10-03.at.4.56.38.PM.moviOS: mWeb SafariScreen.Recording.2024-10-03.at.4.21.06.PM.movMacOS: Chrome / SafariScreen.Recording.2024-10-03.at.4.17.47.PM.movMacOS: DesktopScreen.Recording.2024-10-03.at.4.46.19.PM.mov |
@Julesssss Bump here |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay this tested well for me after adjusting my test device time. I'll add a test for QA.
@Krishna2323 could you please just merge main before I merge? Thanks
main merged. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.0.47-1 🚀
|
This PR is failing for Web because of issue #50594 |
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.47-4 🚀
|
Details
Fixed Issues
$ #47800
PROPOSAL: #47800 (comment)
Tests
Not now
in allow location modal, the expense should submitNot now
in allow location modalNot now
in allow location modal, the expense should submitOffline tests
Not now
in allow location modal, the expense should submitNot now
in allow location modalNot now
in allow location modal, the expense should submitQA Steps
Not now
in allow location modal, the expense should submitNot now
in allow location modalNot now
in allow location modal, the expense should submitPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4