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

[DUPE, PAY SYED] [Distance] - Distance amount is displayed in the manual request money section #26979

Closed
1 of 6 tasks
kbecciv opened this issue Sep 7, 2023 · 10 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented Sep 7, 2023

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. Click the "+" icon.
  2. Select "Request money" and then choose "distance."
  3. Choose the starting and finishing points.
  4. Proceed by clicking the "Next" button.
  5. Navigate back and check the manual request money section

Expected Result:

The Distance amount should not be visible in the manual request money section

Actual Result:

The Distance amount is also displayed in the manual request money section.

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.6
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

Screen.Recording.2023-09-04.at.12.11.20.AM.mov
Recording.4322.mp4

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

View all open jobs on GitHub

@kbecciv kbecciv 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 @jliexpensify (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

@s-alves10
Copy link
Contributor

s-alves10 commented Sep 7, 2023

Proposal

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

Distance amount is displayed in the manual request page

What is the root cause of that problem?

When tapping the tab button, we reset the money request info

IOU.resetMoneyRequestInfo(moneyRequestID);

So the amount is set back to 0 and the MoneyRequestAmountForm receives the updated amount value(0).

The problem is here

useEffect(() => {
if (!currency || !amount) {
return;
}
const amountAsStringForState = CurrencyUtils.convertToFrontendAmount(amount).toString();
setCurrentAmount(amountAsStringForState);
setSelection({
start: amountAsStringForState.length,
end: amountAsStringForState.length,
});
// we want to update the state only when the amount is changed
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [amount]);

When !amount is true, we don't update the currentAmount.

This is the root cause

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

We need to update the currentAmount when amount is 0 as well.
Remove the !amount condition above and update the amountAsStringForState as below

    useEffect(() => {
        if (!currency) {
            return;
        }
        const amountAsStringForState = amount ? CurrencyUtils.convertToFrontendAmount(amount).toString() : '';
        ...
    }, [amount]);

This works as expected

Result
26979.mp4

What alternative solutions did you explore? (Optional)

@akinwale
Copy link
Contributor

akinwale commented Sep 7, 2023

This is a duplicate of #26945.

@ayazhussain79
Copy link
Contributor

ayazhussain79 commented Sep 7, 2023

Can anyone confirm which issue was reported first? I reported this one on September 4th, and what about the #26945 issue?

@jliexpensify
Copy link
Contributor

Hi @ayazhussain79 the other bug was reported by Applause's Internal QA process. I'm happy to close this issue as the dupe and pay you the $50 in Upworks.

@jliexpensify
Copy link
Contributor

@s-alves10 - since this issue will be closed, if you haven't already, please post your proposal in #26945

@jliexpensify
Copy link
Contributor

Payment Summary:

Upworks job

@jliexpensify jliexpensify changed the title [Distance] - Distance amount is displayed in the manual request money section [DUPE, PAY SYED] [Distance] - Distance amount is displayed in the manual request money section Sep 8, 2023
@ayazhussain79
Copy link
Contributor

@jliexpensify Ok offer accepted. Thank you

@jliexpensify
Copy link
Contributor

Paid and job removed.

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

No branches or pull requests

5 participants