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 2024-08-14] [$250] Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline #46371
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
Version Number: 9.0.13-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
@alexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Because canUnholdRequest is false, the unHold option doesn't display
More detail in ReportUtils.canHoldUnholdReportAction function moneyRequestReport.parentReportActionID is undefined -> parentReportAction is undefined -> isDeletedParentAction is true -> canHoldOrUnholdRequest is false -> canUnholdRequest is false
The underlying issue is that when we approve the request, we don't to include the parentReportActionID in the new iouReport.
What changes do you think we should make in order to solve the problem?
In the buildOptimisticExpenseReport and buildOptimisticReportPreview functions, we need to update them to incorporate the new parameter.
An alternative approach is to use optimisticExpenseReport.parentReportActionID directly in buildOptimisticReportPreview instead of adding a new parameter. However, I prefer the previous approach because it is safer.
Another Bug
While addressing the original bug, I discovered an additional issue. We can observe this new bug in the bug video at timestamp 0:52.
The total amount in the report preview (and in iouReport) isn’t updated when a partial approval occurs
Causes and solutions
We’re not updating the total amount in the optimistic data. To resolve this issue, we need to adjust the total amount for iouReport and reportPreview using the unheldTotal field, similar to what we did previously
Please re-state the problem that we are trying to solve in this issue.
hold option is missing on the report details of the held expense after it is moved to a new report offline
What is the root cause of that problem?
The held requests are moved to a new expense report and a new report preview is also created. Still, we haven't updated the parentReportActionID of optimisticExpenseReport to the new report preview action.
Another bug here is we updated the total of the new expense report as the amount of the first hold transaction and it's wrong. I think maybe the reason is each hold transaction can have a different currency.
What changes do you think we should make in order to solve the problem?
After creating the optimistic expense report and report preview action, we should update the parentReportActionID of the expense report to the reportActionID of the new report preview action
We should update the total of the new expense report as the total amount of all hold transactions instead of first transaction if all transactions have the same currency.
What alternative solutions did you explore? (Optional)
changed the title [-]Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/-][+][$250] Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/+]on Jul 29, 2024
We should update the total of the new expense report as the total amount of all hold transactions instead of first transaction if all transactions have the same currency.
There was some discussion on the report amounts here and why some of the behavior is intentional 🤔
changed the title [-][$250] Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/-][+][HOLD for payment 2024-08-14] [$250] Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/+]on Aug 7, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.17-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@ikevin127] The PR that introduced the bug has been identified. Link to the PR:
[@ikevin127] 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:
[@ikevin127] 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:
[@ikevin127] Determine if we should create a regression test for this bug.
[@ikevin127] 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.
[@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
[@ikevin127] 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.
[@ikevin127] Determine if we should create a regression test for this bug.
[@ikevin127] 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
Precondition: Workspace has an approver (can be workspace owner).
Go to workspace chat.
Submit three expenses to the workspace chat.
Hold two of the expenses.
Go offline.
Go back to the main workspace chat.
Click Approve.
Approve partially (click the green approve button for only compliant expenses).
The two held expenses should show underneath as optimistic.
Click on the new report generated which contains the two held expenses.
Click on any of the held expense preview to go to the transaction thread.
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
Activity
melvin-bot commentedon Jul 27, 2024
Triggered auto assignment to @alexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.lanitochka17 commentedon Jul 27, 2024
@alexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
cretadn22 commentedon Jul 28, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Missing "Unhold" on the report header of held expense after it is moved to new report offline
What is the root cause of that problem?
App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Lines 266 to 267 in 08bb00b
Because
canUnholdRequestis false, theunHoldoption doesn't displayMore detail in
ReportUtils.canHoldUnholdReportActionfunctionmoneyRequestReport.parentReportActionID is undefined->parentReportAction is undefined->isDeletedParentAction is true->canHoldOrUnholdRequest is false->canUnholdRequest is falseThe underlying issue is that when we approve the request, we don't to include the
parentReportActionIDin the new iouReport.What changes do you think we should make in order to solve the problem?
App/src/libs/actions/IOU.ts
Lines 6246 to 6254 in 08bb00b
optimisticExpenseReport is new iouReport
optimisticExpenseReportPreview is new reportAction in chatReport
Thus,
optimisticExpenseReport.parentReportActionIDshould equaloptimisticExpenseReportPreview.reportActionIDIn the buildOptimisticExpenseReport and buildOptimisticReportPreview functions, we need to update them to incorporate the new parameter.
An alternative approach is to use optimisticExpenseReport.parentReportActionID directly in buildOptimisticReportPreview instead of adding a new parameter. However, I prefer the previous approach because it is safer.
Another Bug
While addressing the original bug, I discovered an additional issue. We can observe this new bug in the bug video at timestamp 0:52.
The total amount in the report preview (and in iouReport) isn’t updated when a partial approval occurs
Causes and solutions
We’re not updating the total amount in the optimistic data. To resolve this issue, we need to adjust the total amount for iouReport and reportPreview using the
unheldTotalfield, similar to what we did previouslyApp/src/libs/actions/IOU.ts
Lines 6715 to 6719 in 08bb00b
nkdengineer commentedon Jul 29, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
hold option is missing on the report details of the held expense after it is moved to a new report offline
What is the root cause of that problem?
The held requests are moved to a new expense report and a new report preview is also created. Still, we haven't updated the
parentReportActionIDofoptimisticExpenseReportto the new report preview action.App/src/libs/actions/IOU.ts
Line 6246 in 98d8a5a
App/src/libs/actions/IOU.ts
Line 6254 in 98d8a5a
Then
parentReportActionisundefinedhere and the hold or unhold option doesn't appearApp/src/pages/ReportDetailsPage.tsx
Line 122 in 98d8a5a
Another bug here is we updated the total of the new expense report as the amount of the first hold transaction and it's wrong. I think maybe the reason is each hold transaction can have a different currency.
App/src/libs/actions/IOU.ts
Line 6250 in 98d8a5a
What changes do you think we should make in order to solve the problem?
parentReportActionIDof the expense report to thereportActionIDof the new report preview actionApp/src/libs/actions/IOU.ts
Line 6254 in 98d8a5a
What alternative solutions did you explore? (Optional)
[-]Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/-][+][$250] Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/+]melvin-bot commentedon Jul 29, 2024
Job added to Upwork: https://www.upwork.com/jobs/~0154caef32a9b3ac64
melvin-bot commentedon Jul 29, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (
External)robertjchen commentedon Jul 29, 2024
There was some discussion on the report amounts here and why some of the behavior is intentional 🤔
25 remaining items
[-][$250] Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/-][+][HOLD for payment 2024-08-14] [$250] Hold - Missing "Unhold" on the report header of held expense after it is moved to new report offline[/+]melvin-bot commentedon Aug 7, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Aug 7, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.17-2 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 2024-08-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Aug 7, 2024
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:
ikevin127 commentedon Aug 11, 2024
Regression Test Proposal
Precondition: Workspace has an approver (can be workspace owner).
Do we agree 👍 or 👎.
ikevin127 commentedon Aug 14, 2024
cc @alexpensify
alexpensify commentedon Aug 14, 2024
Payouts due: 2024-08-14
Upwork job is here.
alexpensify commentedon Aug 14, 2024
I've completed the payment process via Upwork and will close this issue for now. Later this week, I'll create the regression test request.