You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-11-22] [Payment due: 17 Nov] [$500] Dev: amount does not appears after split bill in offline mode #28330
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor
Split the money which will redirects to report screen
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
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
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.
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)
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
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?
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
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.
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
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:
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:
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
Invite new member to WS
Go offline
Press FAB > Request money > Manual
Enter amount > Select invited member > Split
Verify that split request is created and amount shows in split preview
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor
Activity
[-]Dev: amount does not appears after split bill in offline mode[/-][+][$500] Dev: amount does not appears after split bill in offline mode[/+]melvin-bot commentedon Sep 27, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01102a92c1f230ce56
melvin-bot commentedon Sep 27, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (
External)studentofcoding commentedon Sep 27, 2023
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
MoneyRequestPreviewcomponent, specifically in thegetDisplayAmountTextfunction. 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:
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.
What alternative solutions did you explore? (Optional)
None
Result
amount.mp4
tienifr commentedon 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.iouReportIDis undefined, it's retrieving thereport_undefinedkey, which exists inallReportswith the default valueSo 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
allReportscontainsreport_undefinedis that sometimes the openReport is called with an undefined reportID value, so it saves areport_undefinedkey in Onyx.What changes do you think we should make in order to solve the problem?
reportIDis falsyThis will fix it for all occurrences of
openReport, an alternative is to fix it at all the places where we callopenReportto make sure we don't call it with falsyreportIDundefinedif thereportIDis undefined, so it will never query for such invalidreport_undefinedkey in Onyx. We can extract it to another util function togetReportand reuse it. Or we can fix and reuse this getReportWhat alternative solutions did you explore? (Optional)
We might also want to guard against potential invalid values of
reportIDlike'null'as well.melvin-bot commentedon Oct 2, 2023
Triggered auto assignment to @sophiepintoraetz (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 2, 2023
sophiepintoraetz commentedon Oct 3, 2023
Not overdue - just waiting on proposal review!
55 remaining items
[-][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[/+]melvin-bot commentedon Nov 15, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon 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.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon 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:
sophiepintoraetz commentedon Nov 22, 2023
Offers sent - @situchan - I'll complete payment for yours once you've done the checklist, thank you!
melvin-bot commentedon Nov 27, 2023
@johnmlee101, @sophiepintoraetz, @situchan, @tienifr Huh... This is 4 days overdue. Who can take care of this?
situchan commentedon Nov 27, 2023
Regression Test Proposal
sophiepintoraetz commentedon Nov 28, 2023
All paid here.