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-10-23] [HOLD for payment 2023-10-23] [$1000] Workspace - App crashes when entering Bank account page #26958

Closed
1 of 6 tasks
lanitochka17 opened this issue Sep 7, 2023 · 52 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 7, 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. Launch New Expensify app.
  2. Create a new workspace.
  3. Go to Bank account > Update to USD.
  4. Click Connect online with Plaid.
  5. Return to previous page using device back navigation.
  6. Click Connect manually.
  7. Return to previous page using device back navigation.
  8. In workspace page, click Bank account.

Expected Result:

App does not crash

Actual Result:

App crashes

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.65-2

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6191172_Screen_Recording_20230907_153227_One_UI_Home.mp4

logs2.txt

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d23926d190e45c2e
  • Upwork Job ID: 1700058465699299328
  • Last Price Increase: 2023-09-24
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 7, 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

@bernhardoj
Copy link
Contributor

bernhardoj commented Sep 7, 2023

Proposal

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

Opening the bank account after going back using the device back button/swipe will crash the app (on dev, an error will show)

What is the root cause of that problem?

The error I got is Cannot read property 'focus' of null.
image

This error comes from the auto-focus code of text input. On Android, shouldDelayFocus is set to true.

let focusTimeout;
if (props.shouldDelayFocus) {
focusTimeout = setTimeout(() => input.current.focus(), CONST.ANIMATED_TRANSITION);
return;
}
input.current.focus();
return () => {
if (!focusTimeout) {
return;
}
clearTimeout(focusTimeout);
};

When we open the bank account page for the first time by going to Workspace > Bank Account > Connect manually, the focus works fine. When we press the device back button, it navigates us to the workspace page instead of the initial page of a bank account (where there is a plaid and manual option).

Opening the Bank account once again takes us immediately to the 1st step of bank account
image

and somehow the page is unmounted[1] once and then remounted. The issue is that when the page is unmounted, we don't clear the focus timeout (see above code that we return nothing after setting a timeout), so when the timeout is done, the ref is already null.

[1] explanation of why the 1st page of the bank account page is unmounted:
The step of the bank account is saved locally. When we open the bank account again, it will show the last step that is saved in Onyx. But opening the bank account page will also trigger an OpenReimbursementAccountPage request which will replace the 1st step with a loading screen. This is where the 1st step is unmounted and then remounted once the request is done.

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

When shouldDelayFocus is true, we should return a cleanup function to clear the timeout by moving this up inside if (props.shouldDelayFocus)

return () => {
if (!focusTimeout) {
return;
}
clearTimeout(focusTimeout);
};

@laurenreidexpensify laurenreidexpensify added the External Added to denote the issue can be worked on by a contributor label Sep 8, 2023
@melvin-bot melvin-bot bot changed the title Workspace - App crashes when entering Bank account page [$500] Workspace - App crashes when entering Bank account page Sep 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01d23926d190e45c2e

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

melvin-bot bot commented Sep 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@laurenreidexpensify, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

@laurenreidexpensify
Copy link
Contributor

@thesahindia bump for review thanks

@melvin-bot melvin-bot bot removed the Overdue label Sep 12, 2023
@thesahindia
Copy link
Member

@bernhardoj can you check if you are still getting the error? I was able to repro it in the morning but now I can't repro it.

@bernhardoj
Copy link
Contributor

bernhardoj commented Sep 13, 2023

@thesahindia Yes, still reproducible

Screen.Recording.2023-09-13.at.12.22.04.mov

@thesahindia
Copy link
Member

For some reason I can't repro it. I am on latest main.

Screen.Recording.2023-09-14.at.1.17.21.AM.mov

@bernhardoj
Copy link
Contributor

@thesahindia hmm, that's really weird. I can still reproduce it on main. Can you check whether your app runs on debug mode or not?

we can ask QA to retest it too

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2023
@laurenreidexpensify
Copy link
Contributor

@thesahindia bump ^^

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

@laurenreidexpensify @thesahindia 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!

@melvin-bot melvin-bot bot added the Overdue label Sep 21, 2023
@thesahindia
Copy link
Member

@laurenreidexpensify, everything is fine on my end. Let's ask QA team to test it again.

@melvin-bot melvin-bot bot removed the Overdue label Sep 21, 2023
@bernhardoj
Copy link
Contributor

Thanks! PR is ready

cc: @thesahindia

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Workspace - App crashes when entering Bank account page [HOLD for payment 2023-10-23] [$1000] Workspace - App crashes when entering Bank account page Oct 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@thesahindia] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-23] [$1000] Workspace - App crashes when entering Bank account page [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-23] [$1000] Workspace - App crashes when entering Bank account page Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@thesahindia] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Oct 23, 2023
@laurenreidexpensify
Copy link
Contributor

laurenreidexpensify commented Oct 24, 2023

Payment Summary:

  • External issue reporter- Applause N/A
  • Contributor that fixed the issue - @bernhardoj $1000 + $500, please apply to job in Upwork Payment issued in Upwork
  • Contributor+ that helped on the issue and/or PR @thesahindia $1000 + $500, please request payment in newdot

@laurenreidexpensify
Copy link
Contributor

@thesahindia bump for checklist steps so we can close this one out!

@bernhardoj
Copy link
Contributor

@laurenreidexpensify hi, I think we are eligible for the 50% bonus.

@melvin-bot melvin-bot bot added the Overdue label Oct 27, 2023
@laurenreidexpensify
Copy link
Contributor

@thesahindia bump for checklist thanks

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 27, 2023
@laurenreidexpensify
Copy link
Contributor

@thesahindia bump to get this one closed thanks

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@thesahindia
Copy link
Member

I think it was a regression from the refactor. Not sure if we could have prevented it.

Here are the steps if we wanna add a test case -

  1. Open Settings > Workspaces > Select any workspace > Bank Account
  2. Press "Connect manually"
  3. Go back using the browser/device back button or swipe back
  4. Press "Connect manually" again
  5. Verify the 1st step is open with the first input is focused

@JmillsExpensify
Copy link

$1,500 payment approved for @thesahindia based on this summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

7 participants