Add better error handling for Onfido#5316
Conversation
Jag96
left a comment
There was a problem hiding this comment.
This looks like a good addition to me, and the comments/context is helpful as well.
I couldn't get Onfido to work on desktop or web no matter how hard I tried to take a picture of my ID via my phone. But tested this with the current web-secure changes and it caught the weird error about referrer.
I think reverting the latest secure change locally would be an easy way to test this 👍
|
Ok updated the tests here with a diff to apply that will make the error we experienced more noticeable. I was able to run through Onfido on web by using a passport instead of driver's license. Not too sure why I was having issues with that last week. This should be ready now. |
There was a problem hiding this comment.
The code looks good to me, I was able to reproduce until step 12 in the simulator though. The Onfido didn't fail after capturing a black screen and allowed me to continue with the next steps (I tried 3 times with diff accounts and ensured the setApplicationId is set in web-secure), not sure if I'm missing something 🤔
If I cancel the Onfido process the app comes back to the Company Step 👍🏽
To clarify, is your simulator build using the local Web-Secure? What do you have set for |
This is my and I think I was using local Web-Secure because I added a breakpoint in |
|
Updated this one. @marcochavezf I'm not sure why this isn't working for you but thought it might have to do with using an iOS simulator. So, I re-tested with a sim instead of my hardware device and did not see what you're seeing there. |
|
Here's the error I got while testing iOS simulator: |
|
✋ 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 @marcaaron in version: 1.1.1-9 🚀
|




cc @Jag96 @ctkochan22 I couldn't get Onfido to work on desktop or web no matter how hard I tried to take a picture of my ID via my phone. But tested this with the current web-secure changes and it caught the weird error about referrer.
Details
Onfido was throwing a pretty clear error but we are not logging it at all or handling it to allow the user to attempt the flow again. This will log these errors and also try to move the user back to the Company Step so they can attempt to go through Onfido again.
Fixed Issues (Only related to does not fix)
https://github.com/Expensify/Expensify/issues/177787#
Tests (iOS only)
In order to test this we need to force the Web-Secure API to do something it shouldn't do like set a bad application id or referrer. For this test I just applied this diff in Web-Secure before testing:
freePlanbetaOther Platforms
Test we can upload documents without issue with and without the diff applied.
QA Steps
None
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android