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

[$500] Android-IOU- Tapping back and then next in Request Money flow shows wrong page with $0 amount, then app crashes #28707

Closed
3 of 6 tasks
izarutskaya opened this issue Oct 3, 2023 · 57 comments
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

Comments

@izarutskaya
Copy link

izarutskaya commented Oct 3, 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 app
  2. Tap fab
  3. Tap Request money
  4. Enter an amount
  5. Tap next
  6. Select an user
  7. Tap back button in app and navigate to request money page
  8. Tap next

Expected Result:

When user taps "next" from request money page, the contacts page must be displayed and app must not crash.

Actual Result:

When user taps "next" from request money page, the contacts page must be displayed. But, again the request money page is displayed with Zero amount in mweb and web. In Android, the request money page is displayed with Zero amount and then 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.76-0

Reproducible in staging?: Y

Reproducible in production?: Y

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

Bug6222926_1696319976689.mweb0.mp4
Bug6222926_1696319830423.andcrasjee.mp4

utest-dl.s3.amazonaws.com_12102_26469_432782_6222926_bugAttachment_Bug6222926_1696319226552%21crash.txt_X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20231003T101613Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIAJ.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/~0123350be82c6cc62d
  • Upwork Job ID: 1712353638661038080
  • Last Price Increase: 2023-10-12
  • Automatic offers:
    • BhuvaneshPatil | Contributor | 27156465
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

@melvin-bot
Copy link

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

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Oct 3, 2023

Proposal

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

Android-IOU- Instead of contacts, same request amount page with 0 amount shown and app crashes.
During flow of creating a money request if we go back from select participants page to money request amount and after changing amount, if we try to go next page. Amount changes to 0 and we are redirected to amount page.
This behaviour is happening on Web as well

What is the root cause of that problem?

Error looks like this -
Screenshot 2023-10-04 at 7 19 27 AM

This is happening because of we are trying to call focus() of null, If we look at the code -

if ([CONST.PLATFORM.DESKTOP, CONST.PLATFORM.WEB].includes(getPlatform()) && !prevProps.isFocused && this.props.isFocused && this.props.autoFocus && this.textInput) {
setTimeout(() => {
this.textInput.focus();
}, CONST.ANIMATED_TRANSITION);
}

We are already checking if textInput is null or not, but we call focus method after certain time period and the callback is executed we have textInput is null.

There are two instances where we are checking if we have to reset the IOU.

const shouldReset = iou.id !== moneyRequestID;

and
const shouldReset = iou.id !== moneyRequestID;

When we select the participant and reach the confirmation page iou has id something like - request{reportID} here reportID is the participant chat ID.
And once we go back to change amount in the flow, we are checking the condition(shown in code) and thus we always reset the IOU.

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

if we just want to solve the error causing the app to crash, we shall add the check in callback of timeout for textInput is null or not. And if we want to fix the amount not able to updated we can apply following changes(this will solve app crashing as well)
We shall add the check to shouldReset at both places about empty value of reportID.
Hence, if the reportID is empty we don't reset the IOU.
example =

const shouldReset = iou.id !== moneyRequestId && !isNewReportIDSelectedLocally.current && !_.isEmpty(reportID.current);

What alternative solutions did you explore? (Optional)

result -

Screen.Recording.2023-10-03.at.4.42.47.PM.mov

@melvin-bot melvin-bot bot added the Overdue label Oct 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 10, 2023

@sakluger Still overdue 6 days?! Let's take care of this!

@sakluger sakluger changed the title Android-IOU- Instead of contacts, same request amount page with 0 amount shown and app crashes Android-IOU- Tapping back and then next in Request Money flow shows wrong page with $0 amount, then app crashes Oct 12, 2023
@sakluger
Copy link
Contributor

Good bug report, I updated the issue title to be a bit more clear.

@melvin-bot melvin-bot bot removed the Overdue label Oct 12, 2023
@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Oct 12, 2023
@melvin-bot melvin-bot bot changed the title Android-IOU- Tapping back and then next in Request Money flow shows wrong page with $0 amount, then app crashes [$500] Android-IOU- Tapping back and then next in Request Money flow shows wrong page with $0 amount, then app crashes Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0123350be82c6cc62d

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

melvin-bot bot commented Oct 12, 2023

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

@mananjadhav
Copy link
Collaborator

mananjadhav commented Oct 12, 2023

@BhuvaneshPatil's proposal looks good here. I would recommend solving the amount issue as well.

🎀 👀 🎀 C+ reviewed.

@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

📣 @mananjadhav Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Oct 12, 2023

📣 @BhuvaneshPatil 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@BhuvaneshPatil
Copy link
Contributor

Holding this for #29468

Pressing back makes app crash

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Oct 12, 2023

@arosiclair @mananjadhav
I have tried reproducing the bug, seems like there has been change in assigning reportID.
But there is one other bug very similar to this that I have spotted with same RCA.
steps -

  • Start money request flow
  • Enter some amount
  • Go to next page, and select participant for split (not request)
  • Go to next page
  • Go back, go back (on amount page)
  • Change amount and click next
  • Amount is reset to zero
Screen.Recording.2023-10-13.at.5.37.14.PM.mov

@sakluger
Copy link
Contributor

Oh interesting. @BhuvaneshPatil just to confirm, the original bug is not reproduceable, but this new, similar issue is reproduceable? And your same proposal will fix the new issue?

If that's true, then I think we should continue on with your solution, but I'd like @mananjadhav's feedback as well.

@BhuvaneshPatil
Copy link
Contributor

Yes, the root cause is same.

@BhuvaneshPatil
Copy link
Contributor

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2023
@BhuvaneshPatil
Copy link
Contributor

I'll create the PR today

@sakluger
Copy link
Contributor

Thanks @MitchExpensify! I'll take this one back over.

@BhuvaneshPatil
Copy link
Contributor

Hello, Shall I mention this as fixed issue in PR? The doubt is because it caused a regression as well

@mananjadhav
Copy link
Collaborator

yeah please add this issue as well for fixed issues.

@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
Copy link

melvin-bot bot commented Nov 20, 2023

@mananjadhav, @sakluger, @arosiclair, @BhuvaneshPatil Whoops! This issue is 2 days overdue. Let's get this updated quick!

@arosiclair
Copy link
Contributor

@BhuvaneshPatil what's the status of your follow up PR?

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2023
@BhuvaneshPatil
Copy link
Contributor

@arosiclair Sorry for delay, was caught up in situation in family. Just recording is remaining.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 20, 2023
@BhuvaneshPatil
Copy link
Contributor

raised the PR #31579

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Dec 14, 2023
Copy link

melvin-bot bot commented Dec 14, 2023

This issue has not been updated in over 15 days. @mananjadhav, @sakluger, @arosiclair, @BhuvaneshPatil eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@BhuvaneshPatil
Copy link
Contributor

PR has been merged

@arosiclair arosiclair added Daily KSv2 and removed Reviewing Has a PR in review Monthly KSv2 labels Dec 14, 2023
@arosiclair
Copy link
Contributor

Automations failed it looks like. This was deployed a week ago. I think that means this is clear for payment @sakluger

@mananjadhav
Copy link
Collaborator

Quick bum on the payout for this one @sakluger

@sakluger
Copy link
Contributor

Summarizing payouts for this issue:

Contributor: @BhuvaneshPatil $500 (paid via Upwork)
Contributor+: @mananjadhav $500 (payable via Manual Request)

Upwork job: https://www.upwork.com/jobs/~0123350be82c6cc62d

@sakluger
Copy link
Contributor

I'm going to close this issue out. @mananjadhav please bump me on Slack if the issue needs to be reopened for your payment.

@JmillsExpensify
Copy link

$500 payment approved for @mananjadhav based on summary above.

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
Projects
None yet
Development

No branches or pull requests

7 participants