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-10-15] [Due for payment 2025-09-30] [$250] We show delete button for unreported card expenses imported with deleting disabled #66724
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2retest-weeklyApply this label if you want this issue tested on a Weekly basis by Applause
Version Number: 9.1.83-1 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:@joekaufmanexpensify Slack conversation (hyperlinked to channel name): #Convert
Action Performed:
Connect a card feed
Make sure "allow deleting transactions" is disabled
Assign a card with expenses
Unreport the expenses
Go to your personal space
Tap one of the expenses.
Expected Result:
We hide the option to delete the expenses, since it maps back to a card on a workspace where transaction deleting is disabled.
Actual Result:
We show delete button, but throw an API error when you try to delete.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence2025-07-17_15-36-54.mp4Recording.1432.mp4
Please re-state the problem that we are trying to solve in this issue.
We show delete button for unreported card expenses imported with deleting disabled
What is the root cause of that problem?
We currently show the delete button for unreported when the user is the owner. The issue occurs because we do not check if the card expense was imported with deletion disabled.
if(isUnreported){// Instead of checking for RESTRICT below, we can use canDeleteCardTransactionByLiabilityType to check for the ALLOW type. => isOwner && canDeleteCardTransactionByLiabilityType(transaction)constisCardTransactionWithCorporateLiability=isCardTransactionUtils(transaction)&&transaction?.comment?.liabilityType===CONST.TRANSACTION.LIABILITY_TYPE.RESTRICT;returnisOwner&&!isCardTransactionWithCorporateLiability;}
And here when right click the IOU to display the popover
if(isActionOwner){// Alternatively, we can return early here if isCardTransactionCanBeDeleted is false, like this: if(!isCardTransactionCanBeDeleted){return false}if(isTrackExpenseAction(reportAction)){returnisCardTransactionCanBeDeleted}
... Other
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We should write tests for getSecondaryReportActions to ensure it does not return the DELETE action and for the isDeleteAction
What alternative solutions did you explore? (Optional)
Return early if isCardTransactionWithCorporateLiability is true. The condition could be moved up, like so:
changed the title [-]We show delete button for unreported card expenses imported with deleting disabled[/-][+][$250] We show delete button for unreported card expenses imported with deleting disabled[/+]on Jul 23, 2025
@mananjadhav / @linhvovan29546@CortneyOfstad 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]
changed the title [-][Due for payment 2025-09-30] [$250] We show delete button for unreported card expenses imported with deleting disabled[/-][+][Due for payment 2025-10-15] [Due for payment 2025-09-30] [$250] We show delete button for unreported card expenses imported with deleting disabled[/+]on Oct 8, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.27-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@mananjadhav / @linhvovan29546@CortneyOfstad 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]
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2retest-weeklyApply this label if you want this issue tested on a Weekly basis by Applause
Activity
melvin-bot commentedon Jul 18, 2025
Triggered auto assignment to @CortneyOfstad (
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.melvin-bot commentedon Jul 21, 2025
@CortneyOfstad Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
linhvovan29546 commentedon Jul 22, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
We show delete button for unreported card expenses imported with deleting disabled
What is the root cause of that problem?
We currently show the delete button for unreported when the user is the owner. The issue occurs because we do not check if the card expense was imported with deletion disabled.
App/src/libs/ReportSecondaryActionUtils.ts
Lines 439 to 441 in 233790a
What changes do you think we should make in order to solve the problem?
We should update the condition to handle this case by checking if the card transaction is imported with deletion disabled.
App/src/libs/ReportSecondaryActionUtils.ts
Lines 439 to 441 in 233790a
And here when right click the IOU to display the popover
App/src/libs/ReportUtils.ts
Line 2521 in 233790a
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We should write tests for
getSecondaryReportActionsto ensure it does not return theDELETEaction and for the isDeleteActionWhat alternative solutions did you explore? (Optional)
Return early if
isCardTransactionWithCorporateLiabilityis true. The condition could be moved up, like so:App/src/libs/ReportSecondaryActionUtils.ts
Line 438 in 233790a
[-]We show delete button for unreported card expenses imported with deleting disabled[/-][+][$250] We show delete button for unreported card expenses imported with deleting disabled[/+]melvin-bot commentedon Jul 23, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021948036590874577665
melvin-bot commentedon Jul 23, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)87 remaining items
melvin-bot commentedon Sep 23, 2025
@mananjadhav / @linhvovan29546 @CortneyOfstad 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]
melvin-bot commentedon Sep 30, 2025
Payment Summary
Upwork Job
BugZero Checklist (@CortneyOfstad)
CortneyOfstad commentedon Oct 2, 2025
Payment Summary
@mananjadhav — to be paid $250 via NewDot
@linhvovan29546 – paid $250 via Upwork
[-][Due for payment 2025-09-30] [$250] We show delete button for unreported card expenses imported with deleting disabled[/-][+][Due for payment 2025-10-15] [Due for payment 2025-09-30] [$250] We show delete button for unreported card expenses imported with deleting disabled[/+]melvin-bot commentedon Oct 8, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.27-6 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-10-15. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 8, 2025
@mananjadhav / @linhvovan29546 @CortneyOfstad 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]
quinthar commentedon Nov 12, 2025
Approved $250 to @mananjadhav