Skip to content

[HOLD for payment 2023-11-22] [Payment due: 17 Nov] [$500] Dev: amount does not appears after split bill in offline mode #28330

Closed

Description

@kbecciv

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. Go offline
  2. Click on FAB icon and select request money
  3. Enter amount and select users for split bill
  4. Split the money which will redirects to report screen
  5. Check amount

Expected Result:

Only owes: appears

Actual Result:

Should show amount

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: Dev 1.3.74-2
Reproducible in staging?: n
Reproducible in production?: n
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-26.at.3.01.04.PM.mov
Screen.Recording.2023-09-26.at.2.56.57.PM.mov

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

View all open jobs on GitHub

Activity

  1. added
    External
    on Sep 27, 2023
  2. changed the title [-]Dev: amount does not appears after split bill in offline mode[/-] [+][$500] Dev: amount does not appears after split bill in offline mode[/+] on Sep 27, 2023
  3. melvin-bot commented on Sep 27, 2023

    @melvin-bot
  4. added
    Help Wanted
    on Sep 27, 2023
  5. melvin-bot commented on Sep 27, 2023

    @melvin-bot

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

  6. studentofcoding commented on Sep 27, 2023

    @studentofcoding
    Contributor

    Proposal

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

    Dev: amount does not appears after split bill in offline mode

    What is the root cause of that problem?

    On MoneyRequestPreview component, specifically in the getDisplayAmountText function. We didn't ensure the function correctly retrieves and displays the split bill amounts even when the device is offline.

    Here is the relevant code block:

        const getDisplayAmountText = () => {
            if (isDistanceRequest) {
                return CurrencyUtils.convertToDisplayString(TransactionUtils.getAmount(props.transaction), props.transaction.currency);
            }
    
            if (isScanning) {
                return props.translate('iou.receiptScanning');
            }
    
            return CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency);
        };
    

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

    We should ensure that this function can correctly retrieve and display the split bill amounts even when the device is offline, with checking if requestAmount and requestCurrency are not null or undefined.

    const getDisplayAmountText = () => {
        if (isDistanceRequest) {
            return CurrencyUtils.convertToDisplayString(TransactionUtils.getAmount(props.transaction), props.transaction.currency);
        }
    
        if (isScanning) {
            return props.translate('iou.receiptScanning');
        }
    
        // Check if requestAmount and requestCurrency are not null or undefined
        if (requestAmount && requestCurrency) {
            return CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency);
        }
    };
    

    What alternative solutions did you explore? (Optional)

    None

    Result

    amount.mp4
  7. tienifr commented on Sep 28, 2023

    @tienifr
    Contributor

    Proposal

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

    What is the root cause of that problem?

    In here, when the oneOnOneChatReport.iouReportID is undefined, it's retrieving the report_undefined key, which exists in allReports with the default value

    {
        isLoadingReportActions: true,
        isLoadingMoreReportActions: false,
        reportName: 'Chat Report',
    }
    

    So it's unable to generate (and later find) an optimistic IOU report here.

    So it will show only owes: in the UI.

    The reason why allReports contains report_undefined is that sometimes the openReport is called with an undefined reportID value, so it saves a report_undefined key in Onyx.

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

    1. Fix openReport so that it will early return if the reportID is falsy
    if (!reportID) {
        return;
    }
    

    This will fix it for all occurrences of openReport, an alternative is to fix it at all the places where we call openReport to make sure we don't call it with falsy reportID

    1. We can make this condition more robust by returning undefined if the reportID is undefined, so it will never query for such invalid report_undefined key in Onyx. We can extract it to another util function to getReport and reuse it. Or we can fix and reuse this getReport

    What alternative solutions did you explore? (Optional)

    We might also want to guard against potential invalid values of reportID like 'null' as well.

  8. added
    Bug
    on Oct 2, 2023
  9. melvin-bot commented on Oct 2, 2023

    @melvin-bot

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

  10. melvin-bot commented on Oct 2, 2023

    @melvin-bot
  11. sophiepintoraetz commented on Oct 3, 2023

    @sophiepintoraetz
    Contributor

    Not overdue - just waiting on proposal review!

  12. 55 remaining items

  13. added
    Awaiting Payment
    on Nov 15, 2023
  14. changed the title [-][Payment due: 17 Nov] [$500] Dev: amount does not appears after split bill in offline mode[/-] [+][HOLD for payment 2023-11-22] [Payment due: 17 Nov] [$500] Dev: amount does not appears after split bill in offline mode[/+] on Nov 15, 2023
  15. removed
    Reviewing
    on Nov 15, 2023
  16. melvin-bot commented on Nov 15, 2023

    @melvin-bot

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

  17. melvin-bot commented on Nov 15, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.99-0 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-11-22. 🎊

    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:

  18. melvin-bot commented on Nov 15, 2023

    @melvin-bot

    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:

    • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
    • [@situchan] 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:
    • [@situchan] 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:
    • [@situchan] Determine if we should create a regression test for this bug.
    • [@situchan] 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.
    • [@sophiepintoraetz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  19. sophiepintoraetz commented on Nov 22, 2023

    @sophiepintoraetz
    Contributor

    Offers sent - @situchan - I'll complete payment for yours once you've done the checklist, thank you!

  20. added
    Daily
    and removed
    Weekly
    on Nov 22, 2023
  21. melvin-bot commented on Nov 27, 2023

    @melvin-bot

    @johnmlee101, @sophiepintoraetz, @situchan, @tienifr Huh... This is 4 days overdue. Who can take care of this?

  22. situchan commented on Nov 27, 2023

    @situchan
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Implement report approvals #24639
    • 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: https://github.com/Expensify/App/pull/24639/files#r1406299214
    • 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: N/A
    • Determine if we should create a regression test for this bug.
    • 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.

    Regression Test Proposal

    1. Invite new member to WS
    2. Go offline
    3. Press FAB > Request money > Manual
    4. Enter amount > Select invited member > Split
    5. Verify that split request is created and amount shows in split preview
  23. sophiepintoraetz commented on Nov 28, 2023

    @sophiepintoraetz
    Contributor

    All paid here.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions