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

iOS/ Android - Payments - Tapping bank account crashes the app #10083

Closed
kavimuru opened this issue Jul 25, 2022 · 8 comments
Closed

iOS/ Android - Payments - Tapping bank account crashes the app #10083

kavimuru opened this issue Jul 25, 2022 · 8 comments
Assignees
Labels
DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2 Reviewing Has a PR in review

Comments

@kavimuru
Copy link

kavimuru commented Jul 25, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Launch the app and login
  2. Toggle the staging server
  3. Tap payments > bank account

Expected Result:

User taken to plaid connection flow

Actual Result:

App is crashed

Workaround:

unknown

Platform:

Where is this issue occurring?

  • iOS
  • Android

Version Number: 1.1.86-0
Reproducible in staging?: y
Reproducible in production?: n
Email or phone of affected tester (no customers): any
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Bug5662711_XWZM2964_1_.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

View all open jobs on GitHub

@kavimuru kavimuru added the DeployBlockerCash This issue or pull request should block deployment label Jul 25, 2022
@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2022

Triggered auto assignment to @neil-marcellini (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@neil-marcellini
Copy link
Contributor

👀

@neil-marcellini
Copy link
Contributor

I believe #9423 is causing the problem, but I haven't pinned it down exactly yet.

@neil-marcellini
Copy link
Contributor

Ok, the problem is with the conditional rendering here. @nkuoch

{this.props.plaidData.error && (
<Text style={[styles.formError, styles.mh5]}>
{this.props.plaidData.error}
</Text>
)}

If props.plaidData.error is an empty string then react native will render and empty string, and not the text component. The solution I used was to wrap it in parentheses, but you can also use a ternary statement or !!props.plaidData.error to evaluate as a boolean. Easy mistake to make! Here's the SO I used to find this https://stackoverflow.com/questions/52368342/invariant-violation-text-strings-must-be-rendered-within-a-text-component

@neil-marcellini neil-marcellini added Reviewing Has a PR in review and removed Reviewing Has a PR in review labels Jul 25, 2022
@neil-marcellini
Copy link
Contributor

There's something else happening here where the plaid link opens twice, so if you try to close it then the second one remains open in a permanent loading state. I'll see if I can figure it out tomorrow.

@kbecciv kbecciv changed the title iOS - Payments - Tapping bank account crashes the app iOS/ Android - Payments - Tapping bank account crashes the app Jul 25, 2022
@luacmartins
Copy link
Contributor

Nice investigation so far @neil-marcellini! Let me know if you need any help with this tomorrow!

@neil-marcellini
Copy link
Contributor

After further investigation it looks like the PlaidLink is rendering with the old plaidLinkToken before the token is cleared with BankAccounts.clearPlaid(). So openLink is called once with the old token, then Onyx.set finishes setting the token to an empty string, and then openPlaidBankLogin returns with the new plaid token, which once again calls openLink.

@neil-marcellini neil-marcellini added the Reviewing Has a PR in review label Jul 26, 2022
@melvin-bot melvin-bot bot closed this as completed Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

4 participants