Skip to content

[HOLD for payment 2023-10-10] [HOLD for payment 2023-10-09] [$500] Android-IOU-Distance IOU amount is auto-filled and displayed in manual request money page #26945

Closed

Description

@izarutskaya

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. Tap distance
  5. Tap Start and select an address
  6. Tap Finish and select an address
  7. Tap next
  8. Select a workspace
  9. Note the Request money amount
  10. Navigate back to Request money page
  11. Tap Manual

Expected Result:

The Distance IOU amount should not be displayed in manual request money page.

Actual Result:

The Distance IOU amount is auto-filled and displayed in manual request money page.

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

Bug6191091_manual.mp4

Expensify/Expensify Issue URL:

Issue reported by: @ashimsharma10

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693999827026719

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01baf90b8cc8571594
  • Upwork Job ID: 1702484361858043904
  • Last Price Increase: 2023-09-15
  • Automatic offers:
    • cubuspl42 | Reviewer | 26852371
    • tienifr | Contributor | 26852372
    • ashimsharma10 | Reporter | 26852374

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 7, 2023
  2. melvin-bot commented on Sep 7, 2023

    @melvin-bot

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

  3. melvin-bot commented on Sep 7, 2023

    @melvin-bot

    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
  4. akinwale commented on Sep 7, 2023

    @akinwale
    Contributor

    Proposal

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

    IOU amount is autofilled and displayed in manual request page when editing Distance request.

    What is the root cause of that problem?

    The amount prop for the MoneyRequestAmountForm component on NewRequestAmountPage is set to iou.amount which retrieves the saved amount from Onyx.

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

    Solution 1
    Conditionally set the amount prop for MoneyRequestAmountForm on NewRequestAmountPage based on the isEditing flag. This is based on the assumption that every new money request should have the initial value as 0. On the other hand, if the value is being edited, it should pick up the Onyx data.

    -amount={iou.amount}
    +amount={isEditing ? iou.amount : 0}

    Solution 2
    Clear the iou from Onyx when the user navigates away from the Distance request page, or when the NewRequestAmountPage comes into focus.

    Solution 3
    Do not set the amount prop value for MoneyRequestAmountForm on NewRequestAmountPage if the page is not in focus. We can use a state variable and then make use of the useIsFocused navigation hook to check this.

    What alternative solutions did you explore? (Optional)

    None.

  5. joh42 commented on Sep 7, 2023

    @joh42
    Contributor

    Proposal

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

    When we go to the manual money request tab after starting a distance request, the amount from the distance request remains.

    What is the root cause of that problem?

    We already reset the data when the tab changes:

    const resetMoneyRequestInfo = () => {
    const moneyRequestID = `${iouType}${reportID}`;
    IOU.resetMoneyRequestInfo(moneyRequestID);
    };

    The problem is that when the manual data tab renders, the new amount value has not yet been reset in Onyx. When it is reset, we do not change the amount since there is a condition returning early if !amount:

    if (!currency || !amount) {
    return;
    }

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

    I suggest we update the aforementioned condition so that we still set the amount if it is 0:

        if (!currency || (!amount && amount !== 0)) {
            return;
        }
    

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  6. joh42 commented on Sep 7, 2023

    @joh42
    Contributor

    Demo of my proposed solution:

    Screen.Recording.2023-09-07.at.13.59.52.mov
  7. joh42 commented on Sep 7, 2023

    @joh42
    Contributor

    Also as per this comment we want to clear the data when we switch between request types: #26579 (comment)

    We still want to reset the money request information because we are sharing the data for a draft money request. If we don't clear the data when a different tab/request type is selected, draft data from the previous type might be included in the new money request.

  8. alexpensify commented on Sep 8, 2023

    @alexpensify
    Contributor

    I've run out of time today and will test soon.

  9. alexpensify commented on Sep 11, 2023

    @alexpensify
    Contributor

    Still on my testing list

  10. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 15, 2023
  11. 50 remaining items

  12. jakub-trzebiatowski commented on Oct 6, 2023

    @jakub-trzebiatowski
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR:
    • 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:
    • 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:
      • No need for additional discussion
    • Determine if we should create a regression test for this bug.
      • Up to the QA team
    • 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.
      • Launch the app.
      • Tap the Floating Action Button (FAB).
      • Select the 'Request Money' option.
      • Access the 'Distance' feature.
      • Click on 'Start' and choose a specific address.
      • Click on 'Finish' and designate a different address.
      • Proceed by tapping 'Next'.
      • Choose your preferred workspace.
      • Take note of the 'Request Money' amount displayed.
      • Navigate back to the 'Request Money' page.
      • Select the 'Manual' option.
      • Confirm that no amount is set (you should see a slightly greyed-out 0)
  13. alexpensify commented on Oct 10, 2023

    @alexpensify
    Contributor

    My mistake, I missed that there was a regression here but was addressed quickly. I need another day to review and confirm the payment amounts. For now, I've paid the reporter.

  14. alexpensify commented on Oct 12, 2023

    @alexpensify
    Contributor

    Here is the payment summary:

    Upwork Job: https://www.upwork.com/jobs/~01baf90b8cc8571594

    *If applicable, the bonuses will be applied on the final payment

    Extra Notes regarding payment: This GH would fall under an urgency bonus but due to regression there won't be one. We did fix the issue quickly, so I'll be keeping the base pay as is for the contributors.

  15. alexpensify commented on Oct 12, 2023

    @alexpensify
    Contributor

    Everyone has been paid in Upwork. I need to create the regression test and will close it.

  16. melvin-bot commented on Oct 16, 2023

    @melvin-bot

    @cubuspl42, @marcochavezf, @alexpensify, @tienifr Whoops! This issue is 2 days overdue. Let's get this updated quick!

  17. alexpensify commented on Oct 16, 2023

    @alexpensify
    Contributor

    Not overdue, I need to create the regression test.

  18. jakub-trzebiatowski commented on Oct 17, 2023

    @jakub-trzebiatowski
    Contributor
    • Contributor that fixed the issue @cubuspl42 $500

    • Contributor+ that helped on the issue and/or PR @tienifr $500

    It's the opposite, but doesn't matter much I guess

  19. alexpensify commented on Oct 18, 2023

    @alexpensify
    Contributor

    Alright, I updated the summary based on the @cubuspl42 feedback Also, I created the regression test, so I'm going to close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions