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
[Due for payment 2025-04-14] [$250] Reports - "Pay" button disappears and reappears if editing expense category more than once #59267
Version Number: 9.1.20-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):ibellicotest+463@gmail.com Issue reported by: Applause Internal Team Device used: Motorola MotoG60 - Android 12 - Chrome / Windows 10 - Chrome App Component: Other
Action Performed:
Open the staging.new.expensify.com website.
Open any workspace chat.
Submit an expense.
Navigate to "Reports"
Open the just created expense.
Tap on "Category" and choose any category for the expense.
Open "Category" again and select a different category.
Check the "Pay" button behaviour after changing category for the second time.
Expected Result:
The payment button should remain visible at all times when changing the expense category.
Actual Result:
The payment button on expense report, disappears and reappears when the user edits the expense category more than once.
// use iouReport.total !== undefined instead of !!iouReport.total because its value can be 0}elseif((isExpenseReport(iouReport)||isInvoiceReportReportUtils(iouReport))&&!Number.isNaN(iouReport.total)&&iouReport.total!==undefined){
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can perform unit test with getUpdateMoneyRequestParams with different test cases.
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Reports - "Pay" button disappears and reappears if editing expense category more than once[/-][+][$250] Reports - "Pay" button disappears and reappears if editing expense category more than once[/+]on Mar 28, 2025
@daledah Thanks for your proposal. From my understanding, you identified the root cause as the BE returning total in two different types (string and number) for the same API call (UpdateMoneyRequestCategory) which does not make sense to me since anytime the category is updated it's the same API we call and we're sending the same data.
I tested this on my side and I reproduced the button flicker right from the initial category update and also for subsequent updates, and the response of UpdateMoneyRequestCategory has the same amount of total instances with both string and number type -> meaning that at least on my side the BE response is consistent between calls ✅
♻ Regarding the solution, given the BE response, the changes make sense and they seem to fix the issue which points to the fact that the current FE logic is the issue, the root cause being either of:
a mistake during initial FE implementation of the logic
a recent change in BE response which invalidated the older FE logic
As for tests, I don't think we need to test the getUpdateMoneyRequestParams function because the issue caused by the faulty check is UI related. Let's go with their proposal if there are no objections 👍
changed the title [-][$250] Reports - "Pay" button disappears and reappears if editing expense category more than once[/-][+][Due for payment 2025-04-14] [$250] Reports - "Pay" button disappears and reappears if editing expense category more than once[/+]on Apr 7, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.23-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ikevin127@sonialiap@ikevin127 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Mar 28, 2025
Triggered auto assignment to @sonialiap (
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.daledah commentedon Mar 28, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The payment button on expense report, disappears and reappears when the user edits the expense category more than once.
What is the root cause of that problem?
When updating category for the first time, BE sends data back with
totalfield is a string:So the logics doesn't run here
App/src/libs/actions/IOU.ts
Lines 3700 to 3716 in 2492a02
Instead it calls here
App/src/libs/actions/IOU.ts
Line 3718 in 2492a02
In
updateIOUOwnerAndTotal, we perform flippingtotalvalue:App/src/libs/IOUUtils.ts
Line 110 in 2492a02
So the
totalvalue will be positive, and these logics below will returns falseApp/src/libs/actions/IOU.ts
Line 8566 in 2492a02
App/src/components/MoneyReportHeader.tsx
Line 184 in 2492a02
App/src/components/MoneyReportHeader.tsx
Line 191 in 2492a02
App/src/components/MoneyReportHeader.tsx
Line 207 in 2492a02
So the button is not shown
After the second update category, the BE send back data with
totalbeingnumber, so the button is shown again.What changes do you think we should make in order to solve the problem?
We should use
Number.isNaNhereApp/src/libs/actions/IOU.ts
Line 3700 in 2492a02
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can perform unit test with
getUpdateMoneyRequestParamswith different test cases.What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Reports - "Pay" button disappears and reappears if editing expense category more than once[/-][+][$250] Reports - "Pay" button disappears and reappears if editing expense category more than once[/+]melvin-bot commentedon Mar 28, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021905565632412255816
melvin-bot commentedon Mar 28, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (
External)FitseTLT commentedon Mar 28, 2025
This is a BE bug
ikevin127 commentedon Mar 28, 2025
@daledah Thanks for your proposal. From my understanding, you identified the root cause as the BE returning
totalin two different types (string and number) for the same API call (UpdateMoneyRequestCategory) which does not make sense to me since anytime the category is updated it's the same API we call and we're sending the same data.I tested this on my side and I reproduced the button flicker right from the initial category update and also for subsequent updates, and the response of
UpdateMoneyRequestCategoryhas the same amount oftotalinstances with both string and number type -> meaning that at least on my side the BE response is consistent between calls ✅♻ Regarding the solution, given the BE response, the changes make sense and they seem to fix the issue which points to the fact that the current FE logic is the issue, the root cause being either of:
As for tests, I don't think we need to test the
getUpdateMoneyRequestParamsfunction because the issue caused by the faulty check is UI related. Let's go with their proposal if there are no objections 👍🎀👀🎀 C+ reviewed
13 remaining items
daledah commentedon Apr 2, 2025
@ikevin127 PR is ready.
[-][$250] Reports - "Pay" button disappears and reappears if editing expense category more than once[/-][+][Due for payment 2025-04-14] [$250] Reports - "Pay" button disappears and reappears if editing expense category more than once[/+]melvin-bot commentedon Apr 7, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 7, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.23-7 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 2025-04-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 7, 2025
@ikevin127 @sonialiap @ikevin127 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
ikevin127 commentedon Apr 12, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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/34092/files#r2040726407.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:https://github.com/Expensify/Expensify/issues/490606
Regression Test Proposal
Do we agree 👍 or 👎.
sonialiap commentedon Apr 14, 2025
Payment summary:
@ikevin127 $250 paid in upwork ✔ Thanks for the checklist!
@daledah $250 paid in upwork ✔