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-11-22] [Payment due: 17 Nov] [$500] Dev: amount does not appears after split bill in offline mode #28330

Closed
2 of 6 tasks
kbecciv opened this issue Sep 27, 2023 · 43 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 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 27, 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. 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

@kbecciv kbecciv added the External Added to denote the issue can be worked on by a contributor label Sep 27, 2023
@melvin-bot melvin-bot bot 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 Sep 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01102a92c1f230ce56

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

melvin-bot bot commented Sep 27, 2023

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 27, 2023
@studentofcoding
Copy link
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

@tienifr
Copy link
Contributor

tienifr commented Sep 28, 2023

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.

@aldo-expensify aldo-expensify added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 2, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@melvin-bot

This comment was marked as duplicate.

@sophiepintoraetz
Copy link
Contributor

Not overdue - just waiting on proposal review!

@melvin-bot melvin-bot bot removed the Overdue label Oct 3, 2023
@sophiepintoraetz
Copy link
Contributor

Bump @situchan

@melvin-bot melvin-bot bot added the Overdue label Oct 6, 2023
@sophiepintoraetz sophiepintoraetz added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Oct 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 7, 2023

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

@melvin-bot

This comment was marked as duplicate.

@sophiepintoraetz
Copy link
Contributor

Hey @adelekennedy, can you please baby sit this issue for me while I'm OOO till the 17 Oct? I've asked for another C+ volunteer here to review the issue, as it seems like @situchan can't get to this.

@melvin-bot melvin-bot bot removed the Overdue label Oct 7, 2023
@situchan
Copy link
Contributor

situchan commented Oct 7, 2023

I will provide update by Monday

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

@situchan will provide update today!

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 11, 2023

@sophiepintoraetz @adelekennedy @situchan 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!

@tienifr
Copy link
Contributor

tienifr commented Oct 30, 2023

is that constant repro step?

Yes

And can you also share video after fix?

Here you are

Screen.Recording.2023-10-30.at.16.22.08.mp4

@situchan
Copy link
Contributor

If same root cause, makes sense to fix it here.
@johnmlee101 will decide whether to continue PR or not

@johnmlee101
Copy link
Contributor

To clarify, the fix is the exact same as previously?

@tienifr
Copy link
Contributor

tienifr commented Oct 31, 2023

@johnmlee101 Yes, can you pls open the GH again and I can raise the PR soon

@johnmlee101 johnmlee101 reopened this Oct 31, 2023
@sophiepintoraetz sophiepintoraetz removed the Needs Reproduction Reproducible steps needed label Nov 1, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 1, 2023
@tienifr
Copy link
Contributor

tienifr commented Nov 15, 2023

@johnmlee101 @sophiepintoraetz The fixed PR is merged and deployed some time ago, can we proceed with next step here? cc @situchan

@sophiepintoraetz
Copy link
Contributor

Yes, payment will be subject to the usual 7 day regression period, so we're still a couple of days out.

@sophiepintoraetz sophiepintoraetz changed the title [$500] Dev: amount does not appears after split bill in offline mode [Payment due: 17 Nov] [$500] Dev: amount does not appears after split bill in offline mode Nov 15, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 15, 2023
@melvin-bot melvin-bot bot 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 Nov 15, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

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

Copy link

melvin-bot bot commented Nov 15, 2023

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:

Copy link

melvin-bot bot commented Nov 15, 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:

  • [@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:

@sophiepintoraetz
Copy link
Contributor

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Nov 22, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

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

@situchan
Copy link
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

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2023
@sophiepintoraetz
Copy link
Contributor

All paid here.

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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants