Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.5k stars 2.85k forks source link

[Hold for Payment 2023-12-21][$1000] IOS - Permission popup indicates wrong message #23421

Closed kbecciv closed 10 months ago

kbecciv commented 1 year ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

Action Performed: Go to phone settings Turn off Microphone permission.

Expected Result:

It should show Alert for Microphone permission.

Actual Result:

t shows Camera permission alert instead of microphone permission

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Version Number: 1.3.42-26 Reproducible in staging?: n/a Reproducible in production?: n/a If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation

https://github.com/Expensify/App/assets/93399543/f1171187-f0ae-4db4-89f4-4cc647426f25

Expensify/Expensify Issue URL: Issue reported by: @DinalJivani Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689948082634299

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01479aaf3e91037a82
  • Upwork Job ID: 1683857056510726144
  • Last Price Increase: 2023-08-08
  • Automatic offers:
    • situchan | Contributor | 26071892
    • DinalJivani | Reporter | 26071895
    • ishpaul777 | Contributor | 27357555
melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @zanyrenney (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

DinalJivani commented 1 year ago

Here's the video for detailed steps for reproduction:

https://github.com/Expensify/App/assets/58871336/5062c49a-d64e-4a09-b8fe-300c31564b6c

zanyrenney commented 1 year ago

We should have this error message: image

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~01479aaf3e91037a82

melvin-bot[bot] commented 1 year ago

Current assignee @zanyrenney is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav (External)

shubham1206agra commented 1 year ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

IOS - Permission popup indicates the wrong message

What is the root cause of that problem?

In

https://github.com/Expensify/App/blob/8b236589fa5f748dc81722545478b9ef20426604/src/components/Onfido/index.native.js#L46-L49

When the permission got failed for the microphone, this code is triggered, which pops up the alert modal, which has the message as the following.

https://github.com/Expensify/App/blob/74ae95c26ea84d2ac87e8c5d026c5cbcc79244fc/src/languages/en.js#L928-L929

What changes do you think we should make in order to solve the problem?

Change the message to

cameraPermissionsNotGranted: 'Camera / Microphone permissions not granted',
cameraRequestMessage: 'You have not granted us either camera or microphone access. We need access to both for complete verification.',

And similar message for other languages

Alternative Solutions

May want to shift towards OnfidoCaptureType.MOTION instead of VIDEO. (Maybe it's in the territory of feature request). DOCS: https://github.com/onfido/react-native-sdk#1-creating-the-sdk-configuration

ishpaul777 commented 1 year ago

Proposal

Problem

IOS - Permission popup indicates wrong message when asking for permission for microphone, instead of requesting for microphone it asks for camera permission

Root cause

Here we are checking for camera permission and based on that we are showing the popup message, microphone permission is not handled so even if errorMessage is for microphone permission it will show the popup message for camera permission because of this condition CONST.ONFIDO.ERROR.USER_CAMERA_DENINED is genric error message triggering alert with camera permission request.

if (_.contains([CONST.ONFIDO.ERROR.USER_CAMERA_PERMISSION, CONST.ONFIDO.ERROR.USER_CAMERA_DENINED, CONST.ONFIDO.ERROR.USER_CAMERA_CONSENT_DENIED], errorMessage)) {
    Alert.alert(
        ......

Changes

  1. we need to add/modify constants in CONST.ONFIDO.ERROR

ref - https://github.com/onfido/onfido-ios-sdk/blob/master/README.md#response-handler-errors

USER_CAMERA_DENINED: 'Onfido.OnfidoFlowError.cameraPermission', // before "Onfido.OnfidoFlowError"
USER_MICROPHONE_PERMISSION: 'Encountered an error: microphonePermission',
USER_MICROPHONE_DENINED: 'Onfido.OnfidoFlowError.microphonePermission',
  1. check for camera and microphone permission, so we need check for microphone and camera permission seperately
// Replace the previous condition that checks for camera permission with separate checks for camera and microphone permissions.
if (_.contains([CONST.USER_CAMERA_PERMISSION, CONST.USER_CAMERA_DENIED], errorMessage)) {
    // Alert for camera permission
} else if (_.contains([CONST.USER_MICROPHONE_PERMISSION, CONST.USER_MICROPHONE_DENIED], errorMessage)) {
    // Alert with desired translated message for microphone permission (Add the phrase keys to the translation file)
}
  1. since the CONST.ONFIDO.ERROR.USER_CAMERA_CONSENT_DENIED is edge case and same error message for both camera and microphone permission, we should discuss a alternative behaviour for this case. (like exit the flow or show a generic error message "Something went wrong, please try again")

Alternatively

If we can check whether we have microphone and camera permission programatically. We can show the popup message for microphone/camera permission based on that. With my research I found that we can check for permissions in android. ~I am not sure whether we can check for permissions in IOS within React Native.~ we are using react-native-permissions package already we can check for permission using the check method to check if we have permission for microphone and camera so we dont have to rely on permission error messages coming from onfido

zanyrenney commented 1 year ago

@0xmiroslav any thoughts on these proposals, please?

zanyrenney commented 1 year ago

bump @0xmiroslav ? please can you take a look!

0xmiros commented 1 year ago

@zanyrenney I think we should confirm copy for microphone permission denied message. Both English and Spanish. Should we add Waiting for copy label?

melvin-bot[bot] commented 1 year ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

zanyrenney commented 1 year ago

Hey @0xmiroslav - I agree with Spanish, but why can't we use the same copy as the screenshot provided here? Let me know your thoughts!

zanyrenney commented 1 year ago

Heading ooo we're still debating the copy here and if we need to add the waiting for copy label / get this translated in spanish! thanks in advance for the help moving this along BZ team!

melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

0xmiros commented 1 year ago

Hey @0xmiroslav - I agree with Spanish, but why can't we use the same copy as the screenshot provided here? Let me know your thoughts!

We can use the same. But the copy writer can confirm that English version as well while making Spanish copy.

ishpaul777 commented 1 year ago

i wonder how we can we repro this on simulator? It is lauching the camera directly without asking for permisssions.

johncschuster commented 1 year ago

@0xmiroslav, do you have ideas for how we can reproduce this on simulator? That's a bit beyond my understanding.

melvin-bot[bot] commented 1 year ago

@johncschuster @zanyrenney @0xmiroslav this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

zanyrenney commented 1 year ago

@0xmiroslav bumping for your thoughts on how to reproduce this please?

0xmiros commented 1 year ago

This should be tested on real device as camera, microphone not available on simulator. Contributors neither have cert/provisioning profile nor got apple account invited so cannot test in normal flow. The only way is to change bundle id temporarily and use their own apple account to run on physical device. This is still not applicable for the ones who don't have any apple developer account.

melvin-bot[bot] commented 1 year ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

0xmiros commented 1 year ago

This is straightforward fix so I'd like to recommend someone who is able to test this on physical device as this is required step in PR.

ishpaul777 commented 1 year ago

Can't we collaborate with a C+ who has a physical iphone and can help with testing, cc- @johncschuster @0xmiroslav

johncschuster commented 1 year ago

I'll test this on my mobile device in the morning.

ishpaul777 commented 1 year ago

Bump @0xmiroslav did you get the chance to review my proposal. Let me know if you have any concerns?

situchan commented 1 year ago

I'd like to take this as C+ based on discussion

ishpaul777 commented 1 year ago

@situchan what do you think of my proposal https://github.com/Expensify/App/issues/23421#issuecomment-1650414468

melvin-bot[bot] commented 1 year ago

📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] commented 1 year ago

📣 @DinalJivani 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

zanyrenney commented 1 year ago

thanks for stepping in @situchan - please review the proposal above!

situchan commented 1 year ago

@zanyrenney if https://github.com/Expensify/App/issues/23421#issuecomment-1650027024 can be used as English copy, can we get Spanish version for this?

zanyrenney commented 1 year ago

Have asked for spanish translation here - https://expensify.slack.com/archives/C21FRDWCV/p1692010538975479

zanyrenney commented 1 year ago

Spanish translation is:

Acceso al micrófono denegado Esta aplicación requiere acceso al micrófono de su dispositivo. Habilite el acceso al micrófono para esta aplicación en Configuración > Privacidad > Micrófono

ishpaul777 commented 1 year ago

@situchan we have Spanish text copy now can I get an update here? Let me know if you have any concerns?

situchan commented 1 year ago

@ishpaul777 how are you going to test?

ishpaul777 commented 1 year ago

https://github.com/Expensify/App/issues/23421#issuecomment-1669921569 I asked the question here, i think this is a straightforward fix if anyone can help

ishpaul777 commented 1 year ago

Or If there a way to mock the permissions you know on simulator that would be helpful.

mvtglobally commented 1 year ago

Issue not reproducible during KI retests. (First week)

melvin-bot[bot] commented 1 year ago

@johncschuster, @zanyrenney, @situchan Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] commented 1 year ago

@johncschuster, @zanyrenney, @situchan Huh... This is 4 days overdue. Who can take care of this?

zanyrenney commented 1 year ago

Hmm @mvtglobally i don't see any PR linked. Are you saying this has been solved as a bi-product of another issue?

DinalJivani commented 1 year ago

@zanyrenney @mvtglobally I see this issue is still reproducible not sure what @mvtglobally is missing here.

May be you have fresh installed app and for that you have to go to further steps in which app asks user to enable Microphone, Then you have to follow these steps:

Go to phone settings New Expensify -> Turn off Microphone permission. Go to New Expensify App Go to setting -> Go to any workspace Setup Bank account -> On last step click Save & continue

Attaching full video here.

https://github.com/Expensify/App/assets/58871336/612d02af-5a58-4eed-801a-96604c91d45d

melvin-bot[bot] commented 1 year ago

@johncschuster, @zanyrenney, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

zanyrenney commented 1 year ago

Thanks for coming back here @DinalJivani - @mvtglobally please can you confirm and clarify the answer to my question above here thanks!

zanyrenney commented 1 year ago

bump @mvtglobally can you respond please?

zanyrenney commented 1 year ago

no response here from @mvtglobally so I have asked for clarity in Expensify Open source; here - https://expensify.slack.com/archives/C01GTK53T8Q/p1693820129755339

mvtglobally commented 1 year ago

@zanyrenney our team is running weekly validation and issue may not always be repro as we have different devices. If contributors can still repro, mentioning in comments should help you to proceed. Are you personally able to repro?