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-03-14] [$500] [MEDIUM] Expense Report - In an offline created expense report, a negative request amount is displayed in the Header and Title #36267
Version Number: 1.4.39-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 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
changed the title [-]IOU - In an offline created IOU, a negative request amount is displayed in the Header and Title[/-][+][$500] IOU - In an offline created IOU, a negative request amount is displayed in the Header and Title[/+]on Feb 9, 2024
The storedTotal is a negated numeric value that should be stored in the DB: we store the Expense reports' total as a negative value. However, this shouldn't affect the user-visible content – report title.
Note: this happens only with the enabled report fields beta. With it, we show the report field value in the title. Otherwise, we calculate the title dynamically and negate this amount correctly.
What changes do you think we should make in order to solve the problem?
When coming online, the RequestMoney API response changes this report title to the Expense Report #{reportID}:
We should change the optimistic expense report creation to set the reportName in a similar way so that the optimistic data is aligned with the future Server response:
What alternative solutions did you explore? (Optional)
If we don't want to change the report title format, but keep the "${policy} owes $amount" format for the optimistic expense reports, we should simply use the total instead of storedTotal when building the formattedTotal, which is used only in the report title:
changed the title [-][$500] [MEDIUM] Expense Report - In an offline created expense report, a negative request amount is displayed in the Header and Title[/-][+][HOLD for payment 2024-03-14] [$500] [MEDIUM] Expense Report - In an offline created expense report, a negative request amount is displayed in the Header and Title[/+]on Mar 7, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.48-0 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:
[@mananjadhav / @paultsimura] The PR that introduced the bug has been identified. Link to the PR:
[@mananjadhav / @paultsimura] 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:
[@mananjadhav / @paultsimura] 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:
[@mananjadhav / @paultsimura] 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.
[@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
While we added the storedTotal logic in this commit, I wouldn't count this as an offending PR as I am not sure when the ReportFields was enabled.
Nevertheless, I think it. makes sense to add a regression test for this one. I think the Test steps from the PR are good. I am not sure how do we mention the preconditions here @mallenexpensify.
@mallenexpensify Can you please add the payout summary so that I can raise the request?
Activity
[-]IOU - In an offline created IOU, a negative request amount is displayed in the Header and Title[/-][+][$500] IOU - In an offline created IOU, a negative request amount is displayed in the Header and Title[/+]melvin-bot commentedon Feb 9, 2024
Job added to Upwork: https://www.upwork.com/jobs/~013de0165fd934bba3
melvin-bot commentedon Feb 9, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)melvin-bot commentedon Feb 9, 2024
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.lanitochka17 commentedon Feb 9, 2024
We think that this bug might be related to #vip-bills
paultsimura commentedon Feb 9, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Optimistically created Expense report contains a negative value in the title.
What is the root cause of that problem?
When setting the optimistic
reportNameof the newly created Expense report, we use the incorrect value for the formatted total:App/src/libs/ReportUtils.ts
Lines 2820 to 2824 in ad3d78c
The
storedTotalis a negated numeric value that should be stored in the DB: we store the Expense reports' total as a negative value. However, this shouldn't affect the user-visible content – report title.Note: this happens only with the enabled report fields beta. With it, we show the report field value in the title. Otherwise, we calculate the title dynamically and negate this amount correctly.
What changes do you think we should make in order to solve the problem?
When coming online, the
RequestMoneyAPI response changes this report title to theExpense Report #{reportID}:We should change the optimistic expense report creation to set the
reportNamein a similar way so that the optimistic data is aligned with the future Server response:App/src/libs/ReportUtils.ts
Line 2841 in ad3d78c
What alternative solutions did you explore? (Optional)
If we don't want to change the report title format, but keep the "${policy} owes $amount" format for the optimistic expense reports, we should simply use the
totalinstead ofstoredTotalwhen building theformattedTotal, which is used only in the report title:mallenexpensify commentedon Feb 9, 2024
Checking to see if this fits with #wave6-collect-submitters cuz of "Create a manual request and send it to the WS room"
mananjadhav commentedon Feb 12, 2024
@mallenexpensify Should this be further reviewed?
75 remaining items
[-][$500] [MEDIUM] Expense Report - In an offline created expense report, a negative request amount is displayed in the Header and Title[/-][+][HOLD for payment 2024-03-14] [$500] [MEDIUM] Expense Report - In an offline created expense report, a negative request amount is displayed in the Header and Title[/+]melvin-bot commentedon Mar 7, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 7, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.48-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 2024-03-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 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:
mallenexpensify commentedon Mar 10, 2024
@mananjadhav plz fill out the BZ checklist from above, thx
mananjadhav commentedon Mar 15, 2024
While we added the
storedTotallogic in this commit, I wouldn't count this as an offending PR as I am not sure when the ReportFields was enabled.Nevertheless, I think it. makes sense to add a regression test for this one. I think the Test steps from the PR are good. I am not sure how do we mention the preconditions here @mallenexpensify.
@mallenexpensify Can you please add the payout summary so that I can raise the request?
mallenexpensify commentedon Mar 15, 2024
Contributor: @paultsimura paid $500 via Upwork
Contributor+: @mananjadhav due $500 via NewDot.
Thanks @mananjadhav , I just copy/pasted the preconditions from the PR, along with the steps.
JmillsExpensify commentedon Mar 18, 2024
$500 approved for @mananjadhav based on summary above.