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

fix: App shows blank screen when user denies camera access #6969

Merged

Conversation

phivh
Copy link
Contributor

@phivh phivh commented Dec 31, 2021

Details

  • The blank screen appears with missed handle errors when validating identity. Added 3 error messages that need to handle on iOS and Android platforms.

Fixed Issues

$ #6841

Tests

  • Tested by denying camera access on iOS and Android.

QA Steps

  1. Go to the app
  2. Send money to someone
  3. Click on Continue button
  4. Start verify identity
  5. Deny access to camera
  6. Go back then repeat step 4.
  7. Open settings
  8. Go back the app then verify

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

N/A

Mobile Web

N/A

Desktop

N/A

iOS

ios.mp4

Android

android.mp4

@phivh phivh requested a review from a team as a code owner December 31, 2021 09:34
@MelvinBot MelvinBot requested review from mountiny and parasharrajat and removed request for a team December 31, 2021 09:34
@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@phivh
Copy link
Contributor Author

phivh commented Dec 31, 2021

I have read the CLA Document and I hereby sign the CLA

@mountiny
Copy link
Contributor

@phivh thank you! Could you please copy the line above as per the instructions and comment it here. That is a mandatory step for any contributor. Cheers!

Comment on lines +428 to +429
// eslint-disable-next-line max-len
USER_CAMERA_CONSENT_DENIED: 'Unexpected result Intent. It might be a result of incorrect integration, make sure you only pass Onfido intent to handleActivityResult. It might be due to unpredictable crash or error. Please report the problem to [email protected]. Intent: null \n resultCode: 0',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wrap this in a new line and remove the Eslint comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some reasons that I would like to keep it as it is.

  • Linting required single quote, if we want to wrap the message we need to use backquote `` it will cause an error by lint rule. However, the condition to match this message variable should be 100% match when the error cause, if we wrap it into 2 lines, the condition couldn't work as expected.
  • From my point of view, this is a message under constant variable and not a block logic code so it should not a big deal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Anyways, it is not a blocker.

Comment on lines 525 to 526
cameraRequestTitle: '"New Expensify" Would Like to Access the Camera',
cameraRequestMessage: 'Uh-oh, you have not granted us camera access. We need that to complete this verification',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ask for these translations on the Slack channel or on the issue.

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Rajat's changes. And i will try to confirm the coly of the messages.

@@ -522,6 +522,8 @@ export default {
tryAgain: 'Try again',
verifyIdentity: 'Verify identity',
genericError: 'There was an error while processing this step. Please try again.',
cameraRequestTitle: '"New Expensify" Would Like to Access the Camera',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will also need to ask Marketing team to confirm these translations. I will try to take care of it in the OG issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up. I will wait until getting these official messages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phivh Thank you for understanding, this might be a bit longer than usual given the holidays. Apologies for the delay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mountiny I see, no problem. This is also a chance for me to get more understanding of the process.

Copy link
Contributor

@mountiny mountiny Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phivh Could you actually use the key cameraPermissionsNotGranted we have couple lines above here?

cameraPermissionsNotGranted: 'Camera permissions not granted',

Replate this line with the aforementioned line and swap the translations keys where you have used it to cameraPermissionsNotGranted. And remove this standalone key. I have checked and it seems it was not used anywhere.

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have let the test run. Thank you for your patience on this one. Amazing work so far on this issue 🙌

@@ -522,6 +522,8 @@ export default {
tryAgain: 'Try again',
verifyIdentity: 'Verify identity',
genericError: 'There was an error while processing this step. Please try again.',
cameraRequestTitle: '"New Expensify" Would Like to Access the Camera',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phivh Thank you for understanding, this might be a bit longer than usual given the holidays. Apologies for the delay.

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting one change to the copy. I will follow soon with the Spanish translation.

@parasharrajat
Copy link
Member

@mountiny we will also need Spanish translations

parasharrajat
parasharrajat previously approved these changes Jan 4, 2022
Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving and leaving the translations to @mountiny

🎀 👀 🎀 C+ reviewed

@mountiny
Copy link
Contributor

mountiny commented Jan 4, 2022

@parasharrajat waiting for the translations :)

@mountiny mountiny self-requested a review January 4, 2022 19:35
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have written down some requested changed to the translations. As a title, we would use a copy which was already in the translations page, but it was not used anywhere. So let's just use that key and not forget to change it in the place we need.

Thank you for your patience and for making these updates here @phivh

@@ -522,6 +522,8 @@ export default {
tryAgain: 'Try again',
verifyIdentity: 'Verify identity',
genericError: 'There was an error while processing this step. Please try again.',
cameraRequestTitle: '"New Expensify" Would Like to Access the Camera',
Copy link
Contributor

@mountiny mountiny Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phivh Could you actually use the key cameraPermissionsNotGranted we have couple lines above here?

cameraPermissionsNotGranted: 'Camera permissions not granted',

Replate this line with the aforementioned line and swap the translations keys where you have used it to cameraPermissionsNotGranted. And remove this standalone key. I have checked and it seems it was not used anywhere.

@@ -522,6 +522,8 @@ export default {
tryAgain: 'Try again',
verifyIdentity: 'Verify identity',
genericError: 'There was an error while processing this step. Please try again.',
cameraRequestTitle: '"New Expensify" Would Like to Access the Camera',
cameraRequestMessage: 'Uh-oh, you have not granted us camera access. We need that to complete this verification',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use this copy preferably please.

Suggested change
cameraRequestMessage: 'Uh-oh, you have not granted us camera access. We need that to complete this verification',
cameraRequestMessage: 'You have not granted us camera access. We need access to complete verification.',

@@ -522,6 +522,8 @@ export default {
tryAgain: 'Intentar otra vez',
verifyIdentity: 'Verificar identidad',
genericError: 'Hubo un error al procesar este paso. Inténtalo de nuevo.',
cameraRequestTitle: '"New Expensify" Would Like to Access the Camera',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the cameraPermissionsNotGranted key instead of this and translations should be couple lines above.

@@ -522,6 +522,8 @@ export default {
tryAgain: 'Intentar otra vez',
verifyIdentity: 'Verificar identidad',
genericError: 'Hubo un error al procesar este paso. Inténtalo de nuevo.',
cameraRequestTitle: '"New Expensify" Would Like to Access the Camera',
cameraRequestMessage: 'Uh-oh, you have not granted us camera access. We need that to complete this verification',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lastly, the translation here is following.

Suggested change
cameraRequestMessage: 'Uh-oh, you have not granted us camera access. We need that to complete this verification',
cameraRequestMessage: 'No has habilitado los permisos para acceder a la cámara. Necesitamos acceso para completar la verificaciôn.',

@phivh
Copy link
Contributor Author

phivh commented Jan 5, 2022

Hi @mountiny @parasharrajat
Thanks for your help!
I've updated the translations. Please help to take a look when you guys have a chance.

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great @phivh! Can you just please move the cameraPermissionsNotGranted to the onfidoStep in the translations? Can you also merge main and test it for the last time and we can merge! 🎉 Thank you very much for your work and patience with the translations, this usually does not take so long. Christmas 🎄

@@ -56,7 +56,7 @@ class Onfido extends React.Component {
errorMessage,
)) {
Alert.alert(
this.props.translate('onfidoStep.cameraRequestTitle'),
this.props.translate('cameraPermissionsNotGranted'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we please move the cameraPermissionsNotGranted to the onfidoStep? It is not used anywhere else and it is uncommon to have the keys in the first level.

@phivh
Copy link
Contributor Author

phivh commented Jan 6, 2022

@mountiny I moved the key cameraPermissionsNotGranted under Onfido level and merged the main branch, everything working fine. Thanks for your suggestion.

@mountiny mountiny self-requested a review January 6, 2022 11:53
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phivh Thank you very much! I have thoroughly enjoyed working on this with you and I hope to work with you on plenty more!

@mountiny mountiny merged commit 5863d0f into Expensify:main Jan 6, 2022
@OSBotify
Copy link
Contributor

OSBotify commented Jan 6, 2022

@phivh, Great job getting your first Expensify/App pull request over the finish line! 🎉

I know there's a lot of information in our contributing guidelines, so here are some points to take note of 📝:

  1. Now that your first PR has been merged, you can be hired for another issue. Once you've completed a few issues, you may be eligible to work on more than one job at a time.
  2. Once your PR is deployed to our staging servers, it will undergo quality assurance (QA) testing. If we find that it doesn't work as expected or causes a regression, you'll be responsible for fixing it. Typically, we would revert this PR and give you another chance to create a similar PR without causing a regression.
  3. Once your PR is deployed to production, we start a 7-day timer ⏰. After it has been on production for 7 days without causing any regressions, then we pay out the Upwork job. 💰

So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo! 😊

@OSBotify
Copy link
Contributor

OSBotify commented Jan 6, 2022

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@phivh
Copy link
Contributor Author

phivh commented Jan 6, 2022

Thanks @mountiny @parasharrajat
Nice to work with you guys.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @mountiny in version: 1.1.26-2 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @mountiny in version: 1.1.27-0 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.27-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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

Successfully merging this pull request may close these issues.

4 participants