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

[hold for payment 2023-08-30] IOS - Onfido screen present multiple time when app pushed to Background #23642

Closed
1 of 6 tasks
kbecciv opened this issue Jul 26, 2023 · 44 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@kbecciv
Copy link

kbecciv commented Jul 26, 2023

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:

  1. Go to setting
  2. Go to any workspace
  3. Setup Bank account
  4. On last step click Save & continue
  5. It will present Onfido | Real identity screen
  6. Push app in background
  7. Again open the app

Expected Result:

Onfido | Real identity screen should be presented only once

Actual Result:

Onfido | Real identity screen presented multiple time when app goes in background and again opened

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

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

Image.from.iOS.1.MP4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013b5a7fa2bf8b3fcc
  • Upwork Job ID: 1684610566252363776
  • Last Price Increase: 2023-07-27
  • Automatic offers:
    • ginsuma | Contributor | 25908892
    • DinalJivani | Reporter | 25908893
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@joekaufmanexpensify
Copy link
Contributor

I can reproduce this but I think we're using an Onfido SDK for this, so not sure this is something we can fix. Checking.

@joekaufmanexpensify
Copy link
Contributor

Bumped in Slack

@joekaufmanexpensify
Copy link
Contributor

Okay, this is in Onfido's SDK. Which is open source. So we'll leave this open for now, and see if anyone wants to propose an upstream fix. If we don't get any proposals after a bit, we'll close, since not in our codebase.

@joekaufmanexpensify joekaufmanexpensify added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Jul 27, 2023
@melvin-bot melvin-bot bot changed the title IOS - Onfido screen present multiple time when app pushed to Background [$1000] IOS - Onfido screen present multiple time when app pushed to Background Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~013b5a7fa2bf8b3fcc

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@joekaufmanexpensify
Copy link
Contributor

Awaiting proposals

@jaskarwal
Copy link

Hi @joekaufmanexpensify , I am trying to login but it seems textfield issue while entering code. Cloned from main branch.

@melvin-bot
Copy link

melvin-bot bot commented Jul 29, 2023

📣 @jaskarwal! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@jaskarwal
Copy link

Hi @joekaufmanexpensify ,

Screenshot 2023-07-30 at 12 19 02 AM I am trying to resolve the issue but I am not able to attach to debugger on iOS simulator. Is there any other branch to check ?

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@joekaufmanexpensify
Copy link
Contributor

@allroundexperts any thoughts on the above question?

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2023
@ginsuma
Copy link
Contributor

ginsuma commented Jul 31, 2023

Proposal

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

IOS - Onfido screen present multiple time when app pushed to Background

What is the root cause of that problem?

In ReimbursementAccountPage, we are using IS_LOADING_REPORT_DATA as props.isLoadingReportData to detect isLoading here and show components depend on it.

When the app returns from the background, ReconnectApp is sent, and IS_LOADING_REPORT_DATA state is reset. This makes Onfido mounted again and shows one more "Verify your identity" screen.

App/src/libs/actions/App.js

Lines 161 to 168 in efb4ac6

apiMethod(isReconnecting ? 'ReconnectApp' : 'OpenApp', params, {
optimisticData: [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.IS_LOADING_REPORT_DATA,
value: true,
},
],

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

Creating a ref called isLoadedReportDataRef and using it instead of props.isLoadingReportData to detect isLoading.
This will help us avoid rerendering Onfido.
Code ref:

constructor(props) {
  ...
  this.isLoadedReportDataRef = React.createRef();
  this.isLoadedReportDataRef.current = !props.isLoadingReportData;
}
componentDidUpdate(prevProps) {
  if (prevProps.isLoadingReportData && !this.props.isLoadingReportData) {
      this.isLoadedReportDataRef.current = true;
  }
}
...
const isLoading = !this.isLoadedReportDataRef.current || ...
Result
Untitled.mp4

@joekaufmanexpensify
Copy link
Contributor

Proposal pending review

@allroundexperts
Copy link
Contributor

Hi @jaskarwal!
We usually use Flipper for debugging the native apps.

@allroundexperts
Copy link
Contributor

@ginsuma's proposal has the correct root cause and seems to be working well. Let's go with them!

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

Triggered auto assignment to @NikkiWines, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

📣 @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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 2, 2023
@ginsuma
Copy link
Contributor

ginsuma commented Aug 2, 2023

Thanks for accepting my proposal. The PR #24079 is ready for review.
cc: @allroundexperts @NikkiWines

@joekaufmanexpensify
Copy link
Contributor

Looks like this is pending review from @NikkiWines

@allroundexperts
Copy link
Contributor

Update: We decided to disregard our changes on native Android because of an issue in the Onfido Android sdk. More context in the discussion proceeding this #24079 (comment)

@melvin-bot
Copy link

melvin-bot bot commented Aug 18, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @ginsuma got assigned: 2023-08-02 17:17:07 Z
  • when the PR got merged: 2023-08-18 15:56:02 UTC
  • days elapsed: 11

On to the next one 🚀

@joekaufmanexpensify
Copy link
Contributor

Payment is due on 2023-08-30

@joekaufmanexpensify joekaufmanexpensify changed the title [$1000] IOS - Onfido screen present multiple time when app pushed to Background [hold for payment 2023-08-30] IOS - Onfido screen present multiple time when app pushed to Background Aug 28, 2023
@joekaufmanexpensify
Copy link
Contributor

joekaufmanexpensify commented Aug 29, 2023

After factoring in the 3 day internal delay to merge this issue, there is no penalty here. So we need to make the following payments:

@allroundexperts
Copy link
Contributor

@joekaufmanexpensify I think the penalty should be revisited here. The reason is that the PR was actually reviewed quickly. However, there was a bug in the Onfido's android SDK due to which we had a lot of back and forth conversations. In the end (after consultation with the internal engineer), we decided not to apply the fix to android.

@joekaufmanexpensify joekaufmanexpensify added Daily KSv2 and removed Weekly KSv2 labels Aug 30, 2023
@joekaufmanexpensify
Copy link
Contributor

Got it. I will review further!

@ginsuma
Copy link
Contributor

ginsuma commented Aug 31, 2023

@joekaufmanexpensify For further clarification, the internal engineer approved but forgot to merge #24079 (comment). It took us about three days.

@joekaufmanexpensify
Copy link
Contributor

Ah, thanks for flagging that. Yeah, I see @NikkiWines approved on 2023-08-14, but did not merge until 2023-08-17. If we remove those three days then the time here was 8 business days, so no penalty would be applied.

@joekaufmanexpensify
Copy link
Contributor

Just edited the payment message to reflect that there will no penalty here.

@joekaufmanexpensify
Copy link
Contributor

@ginsuma $1,000 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@DinalJivani $250 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@allroundexperts could you please request $1,000 via NewDot and confirm here once complete?

@allroundexperts
Copy link
Contributor

Done!

@joekaufmanexpensify
Copy link
Contributor

Great, thanks for confirming!

@joekaufmanexpensify
Copy link
Contributor

Going to close this one out for now. If your request is not paid within 7 days, please let me know and I'll look into it.

@joekaufmanexpensify
Copy link
Contributor

As an FYI for the individual paying, payment summary message is here.

@JmillsExpensify
Copy link

Reviewed the details for @allroundexperts. $1,000 payment approved based on BZ summary.

@kavimuru
Copy link

@joekaufmanexpensify @allroundexperts Tester was able to reproduce it today. Should we need a new ticket?

Gbqe4049.1.mp4

@joekaufmanexpensify
Copy link
Contributor

@kavimuru If this is broken again now, wouldn't it be a regression? If so, I'd think we'd fix it on the issue that introduced the regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

8 participants