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-07-10] [$250] Track expense - "Delete expense" option appears for paid tracked expense #43591
Version Number: 1.4.82-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: N/A Issue reported by: Applause - Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat
Submit an expense
Track an expense
Pay elsewhere the expense report
Go to transaction thread of tracked expense
Click 3-dot menu
Expected Result:
"Delete expense" option will not appear for paid tracked expense
Actual Result:
"Delete expense" option appears for paid tracked expense
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@kevinksullivan 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
We manually add isTrackExpenseReport condition to display the delete option in paid track expense
What changes do you think we should make in order to solve the problem?
Before we need to add isTrackExpenseReport condition because canAddOrDeleteTransactions doesn't cover track expense case. At present, let's remove isTrackExpenseReport condition because canAddOrDeleteTransactions also cover track expense case.
Consider to make the same fix to MoneyRequestHeader
What alternative solutions did you explore? (Optional)
so canAddOrDeleteTransactions returns false for selfDM track expense. In a normal money request or workspace track expense, we have IOU/expense report and then the transaction thread.
We also have the same condition in MoneyReportHeader that is shown in the money request report, but self DM track doesn't have money request report, so we can remove it (remove ReportUtils.isTrackExpenseReport(report))
But I don't like this one because canAddOrDeleteTransactions is expected to work with a money request report.
Instead, we can add a new optional param to canAddOrDeleteTransactions called transactionReport and if transactionReport is a self DM track, then returns true.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 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:
[@eh2077] The PR that introduced the bug has been identified. Link to the PR:
[@eh2077] 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:
[@eh2077] 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:
[@eh2077] Determine if we should create a regression test for this bug.
[@eh2077] 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.
[@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
[@eh2077] The PR that introduced the bug has been identified. Link to the PR: I can't find the specific PR that is responsible for this bug. We missed this case when adding the track expense feature to workspace.
[@eh2077] 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: N/A
[@eh2077] 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
[@eh2077] Determine if we should create a regression test for this bug. Yes
Activity
melvin-bot commentedon Jun 12, 2024
Triggered auto assignment to @kevinksullivan (
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 Jun 12, 2024
@kevinksullivan 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 Jun 12, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
"Delete expense" option appears for paid tracked expense
What is the root cause of that problem?
App/src/components/MoneyReportHeader.tsx
Lines 81 to 82 in 9376991
We manually add isTrackExpenseReport condition to display the delete option in paid track expense
What changes do you think we should make in order to solve the problem?
Before we need to add isTrackExpenseReport condition because canAddOrDeleteTransactions doesn't cover track expense case. At present, let's remove isTrackExpenseReport condition because canAddOrDeleteTransactions also cover track expense case.
Consider to make the same fix to MoneyRequestHeader
What alternative solutions did you explore? (Optional)
bernhardoj commentedon Jun 13, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Delete expense option is shown for paid track expense.
What is the root cause of that problem?
The delete option is always shown for track expense report.
App/src/components/MoneyRequestHeader.tsx
Line 103 in a451de4
This is useful for self DM track expense report because the
moneyRequestReportis the parent report which is self DM,App/src/components/MoneyRequestHeader.tsx
Line 63 in a451de4
so
canAddOrDeleteTransactionsreturns false for selfDM track expense. In a normal money request or workspace track expense, we have IOU/expense report and then the transaction thread.chat report -> money request report -> transaction thread
But in self DM track expense, we only have the track expense report/transaction thread
self DM -> track expense report
What changes do you think we should make in order to solve the problem?
We need to also check whether the track expense is a self DM track or not.
We also have the same condition in MoneyReportHeader that is shown in the money request report, but self DM track doesn't have money request report, so we can remove it (remove ReportUtils.isTrackExpenseReport(report))
App/src/components/MoneyReportHeader.tsx
Lines 81 to 82 in a451de4
What alternative solutions did you explore? (Optional)
In
canAddOrDeleteTransactions, returns true if it's a self DM.App/src/libs/ReportUtils.ts
Lines 1506 to 1509 in a451de4
But I don't like this one because
canAddOrDeleteTransactionsis expected to work with a money request report.Instead, we can add a new optional param to
canAddOrDeleteTransactionscalledtransactionReportand iftransactionReportis a self DM track, then returns true.melvin-bot commentedon Jun 17, 2024
@kevinksullivan Huh... This is 4 days overdue. Who can take care of this?
[-]Track expense - "Delete expense" option appears for paid tracked expense[/-][+][$250] Track expense - "Delete expense" option appears for paid tracked expense[/+]melvin-bot commentedon Jun 17, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01bb7f209695580cf5
19 remaining items
melvin-bot commentedon Jul 3, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 3, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-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 2024-07-10. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 3, 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:
eh2077 commentedon Jul 14, 2024
Checklist
Regression test
Do we agree 👍 or 👎
bernhardoj commentedon Jul 14, 2024
I requested the payment in ND.
melvin-bot commentedon Jul 15, 2024
@NikkiWines, @kevinksullivan, @bernhardoj, @eh2077 Eep! 4 days overdue now. Issues have feelings too...
kevinksullivan commentedon Jul 15, 2024
Payment summary:
kevinksullivan commentedon Jul 15, 2024
All set paying @eh2077
JmillsExpensify commentedon Jul 16, 2024
$250 approved for @bernhardoj