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-05-27] [$250] Delete & Hold are present when there are two expense previews, app crashes with Hold option #61448
Version Number: 9.1.40-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers):applausetester+smidod11s1j@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 15.3 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Log in with Expensifail account.
Go to staging.new.expensify.com
Go to 1:1 DM.
Submit two expenses to th euser.
Click on the expense preview.
Click on any expense.
Send a message in the transaction thread.
Click on the report header.
Click Delete expense.
Delete the expense.
Close the RHP.
Now back in the expense report. click More.
Click Delete.
Note that nothing happens after tapping Delete.
Click More.
Click Hold.
Now app crashes with the Hold option.
Expected Result:
In Step 13 and 16, Hold and Delete option should not appear in More options because the expense report has two expense previews - one of the expense previews is present as "Deleted expense" because the expense has a comment.
Actual Result:
In Step 13 and 16, Hold and Delete option are present in More options when the expense report has two expense previews.
In Step 13, nothing happens with Delete option.
In Step 16, app crashes with Hold option.
Please re-state the problem that we are trying to solve in this issue.
In Step 13 and 16, Hold and Delete option are present in More options when the expense report has two expense previews.
In Step 13, nothing happens with Delete option.
In Step 16, app crashes with Hold option.
What is the root cause of that problem?
After we delete the transaction, it will set the transaction to null
It leads to reportTransactions has only 1 transaction => isHoldAction and isDeleteAction will be true
Using canHoldUnholdReportAction instead of isHoldAction and use canDeleteReportAction instead of isDeleteAction
Note: we can do the same with other action
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
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 [-]Delete & Hold are present when there are two expense previews, app crashes with Hold option[/-][+][$250] Delete & Hold are present when there are two expense previews, app crashes with Hold option[/+]on May 6, 2025
// reportActionscould be added to isHoldAction as a new param
const transactionThreadReportID = getOneTransactionThreadReportID(report.reportID, reportActions ?? []);
const isOneExpenseReport = reportTransactions.length === 1;
const transaction = reportTransactions.at(0);
if (!transactionThreadReportID || !isOneExpenseReport || !transaction) {
return false;
}
Also, apply the same way to other actions
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
I suggest adding UTs for both isHoldAction and isDeleteAction function and covering 3 main cases
There are two transactions
There is one transaction
there are two transactions but one of them has been removed
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.
Thanks everyone for the proposals! 🙏 Both solutions worked in my initial tests, and the RCAs are quite similar.
I think we can move forward with @nkdengineer's proposal — it aligns well with the current code structure and makes the dependency on parentReportID explicit, improving clarity and maintainability.
changed the title [-][$250] Delete & Hold are present when there are two expense previews, app crashes with Hold option[/-][+][Due for payment 2025-05-27] [$250] Delete & Hold are present when there are two expense previews, app crashes with Hold option[/+]on May 20, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.46-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@brunovjk@lschurr@brunovjk 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:
[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.
Regression Test Proposal
Precondition:
Log in with Expensifail account, or with beta permissions enabled.
Activity
melvin-bot commentedon May 6, 2025
Triggered auto assignment to @lschurr (
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.nkdengineer commentedon May 6, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Step 13 and 16, Hold and Delete option are present in More options when the expense report has two expense previews.
In Step 13, nothing happens with Delete option.
In Step 16, app crashes with Hold option.
What is the root cause of that problem?
After we delete the transaction, it will set the transaction to
nullIt leads to
reportTransactionshas only 1 transaction =>isHoldActionandisDeleteActionwill be trueApp/src/libs/ReportSecondaryActionUtils.ts
Lines 442 to 444 in 0601503
App/src/libs/ReportSecondaryActionUtils.ts
Lines 454 to 456 in 0601503
App/src/libs/ReportSecondaryActionUtils.ts
Line 275 in 0601503
What changes do you think we should make in order to solve the problem?
We should add the condition like we did with
ContextMenuActionscomponentApp/src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Lines 372 to 375 in 0601503
App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Lines 778 to 784 in 0601503
parentActiontogetSecondaryReportActionsfunction here and passrequestParentReportActionApp/src/components/MoneyReportHeader.tsx
Line 489 in 0601503
canHoldUnholdReportActioninstead ofisHoldActionand usecanDeleteReportActioninstead ofisDeleteActionNote: we can do the same with other action
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
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.
[-]Delete & Hold are present when there are two expense previews, app crashes with Hold option[/-][+][$250] Delete & Hold are present when there are two expense previews, app crashes with Hold option[/+]melvin-bot commentedon May 6, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021919796257257842653
melvin-bot commentedon May 6, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (
External)thelullabyy commentedon May 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Step 13, nothing happens with Delete option.
In Step 16, app crashes with Hold option.
What is the root cause of that problem?
App/src/libs/ReportSecondaryActionUtils.ts
Lines 442 to 444 in fdc8093
App/src/libs/ReportSecondaryActionUtils.ts
Lines 454 to 456 in fdc8093
Both isHoldAction and isDeleteAction action don't cover this case because the deleted transaction will be removed
App/src/libs/ReportSecondaryActionUtils.ts
Line 383 in fdc8093
App/src/libs/ReportSecondaryActionUtils.ts
Line 275 in fdc8093
--> Both variables will be true
What changes do you think we should make in order to solve the problem?
We need to implement another way to verify that there is only one transaction. We must use both transactions and reportAction to detect it.
App/src/libs/ReportSecondaryActionUtils.ts
Line 274 in fdc8093
Also, apply the same way to other actions
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
I suggest adding UTs for both isHoldAction and isDeleteAction function and covering 3 main 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.
brunovjk commentedon May 7, 2025
Thanks everyone for the proposals! 🙏 Both solutions worked in my initial tests, and the RCAs are quite similar.
I think we can move forward with @nkdengineer's proposal — it aligns well with the current code structure and makes the dependency on parentReportID explicit, improving clarity and maintainability.
🎀👀🎀 C+ reviewed
melvin-bot commentedon May 7, 2025
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
8 remaining items
[-][$250] Delete & Hold are present when there are two expense previews, app crashes with Hold option[/-][+][Due for payment 2025-05-27] [$250] Delete & Hold are present when there are two expense previews, app crashes with Hold option[/+]melvin-bot commentedon May 20, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon May 20, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.46-12 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-05-27. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 20, 2025
@brunovjk @lschurr @brunovjk 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]
brunovjk commentedon May 26, 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/58084/files#r2107702286
[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:
[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.
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
lschurr commentedon May 27, 2025
Payment summary: