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-08-09] [$250] Invoice - There is "Delete expense" option in the invoice paid system message #45632
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
For money request action, if the money request action belongs to a money request report (IOU/expense), then it will check using canAddOrDeleteTransactions, otherwise, it will straightly returns true.
In our case, it's not either an IOU/expense report, but an invoice report, so canDeleteReportAction always returns true for the paid system message (which is also an IOU action) which shows the option to delete the message.
What changes do you think we should make in order to solve the problem?
We can simplify the condition by following the condition from the details page as shown below:
we actually don't need isDeletedAction because once we delete an aciont, we can't interact with it anymore, even while offline, but I'm gonna leave that
changed the title [-]Invoice - There is "Delete expense" option in the invoice paid system message[/-][+][$250] Invoice - There is "Delete expense" option in the invoice paid system message[/+]on Jul 19, 2024
@FitseTLT I see you are suggesting 3-4 alternate changes. Can you summarize the best condition to use to avoid displaying the 'Delete expense' option on the system message?`
we should disallow delete menu for all pay type IOU report actions by changing
We can also include other REPORT_ACTION_TYPE if needed
We can narrow down the logic by applying it to pay actions of only invoice reports isInvoiceReport(linkedReport)
We can change
I think any of the above four options will solve this bug, right? If yes, which one do you think is best to add?
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:
[@jayeshmangwani] The PR that introduced the bug has been identified. Link to the PR:
[@jayeshmangwani] 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:
[@jayeshmangwani] 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:
[@jayeshmangwani] Determine if we should create a regression test for this bug.
[@jayeshmangwani] 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.
[@CortneyOfstad] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
[@jayeshmangwani] 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
[@jayeshmangwani] Determine if we should create a regression test for this bug. Yes
[@jayeshmangwani] 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.
Regression Test Proposal
Precondition: Ensure the user has received an invoice.
Open App -> Go the invoice chat.
Click on the invoice preview.
Click on the Pay button to pay the invoice.
Right click on the Paid system message.
Verify that the Delete Expense option does not appear.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Jul 17, 2024
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.izarutskaya commentedon Jul 17, 2024
We think this issue might be related to the #collect project.
FitseTLT commentedon Jul 17, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Invoice - There is "Delete expense" option in the invoice paid system message
What is the root cause of that problem?
As the
linkedReportis an invoice typecanAddOrDeleteTransactionswill not be executed andtruewill be returned hereApp/src/libs/ReportUtils.ts
Lines 1632 to 1635 in 7ba66a1
which will make the report action to be deleteable
What changes do you think we should make in order to solve the problem?
we should disallow delete menu for all
paytype IOU report actions by changingApp/src/libs/ReportUtils.ts
Lines 1624 to 1628 in 7ba66a1
to
We can also include other
REPORT_ACTION_TYPEif neededWe can narrow down the logic by applying it to pay actions of only invoice reports
isInvoiceReport(linkedReport)What alternative solutions did you explore? (Optional)
We can change
App/src/libs/ReportUtils.ts
Line 1635 in 7ba66a1
to
or
alternatively change
App/src/libs/ReportUtils.ts
Line 1632 in 7ba66a1
to
bernhardoj commentedon Jul 18, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
There is an option to delete expense on a paid system message on an invoice report.
What is the root cause of that problem?
The option to delete will show if
canDeleteReportActionreturns true.App/src/libs/ReportUtils.ts
Lines 1616 to 1637 in f392cd3
For money request action, if the money request action belongs to a money request report (IOU/expense), then it will check using
canAddOrDeleteTransactions, otherwise, it will straightly returns true.In our case, it's not either an IOU/expense report, but an invoice report, so
canDeleteReportActionalways returns true for the paid system message (which is also an IOU action) which shows the option to delete the message.What changes do you think we should make in order to solve the problem?
We can simplify the condition by following the condition from the details page as shown below:
App/src/pages/ReportDetailsPage.tsx
Line 195 in f392cd3
App/src/libs/ReportUtils.ts
Lines 1631 to 1636 in f392cd3
to
we actually don't need isDeletedAction because once we delete an aciont, we can't interact with it anymore, even while offline, but I'm gonna leave that
melvin-bot commentedon Jul 19, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01a731bc49d6a020e0
[-]Invoice - There is "Delete expense" option in the invoice paid system message[/-][+][$250] Invoice - There is "Delete expense" option in the invoice paid system message[/+]melvin-bot commentedon Jul 19, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (
External)CortneyOfstad commentedon Jul 19, 2024
@jayeshmangwani we have a couple of proposals above when you have a chance — thank you!
jayeshmangwani commentedon Jul 22, 2024
@FitseTLT I see you are suggesting 3-4 alternate changes. Can you summarize the best condition to use to avoid displaying the 'Delete expense' option on the system message?`
I think any of the above four options will solve this bug, right? If yes, which one do you think is best to add?
20 remaining items
melvin-bot commentedon Aug 2, 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:
CortneyOfstad commentedon Aug 12, 2024
@FitseTLT you have been paid!
@jayeshmangwani can you complete the checklist at your earliest convenience?
CortneyOfstad commentedon Aug 12, 2024
Payment Summary
@FitseTLT — paid $250 via Upwork
@jayeshmangwani — to be paid $250 via NewDot
jayeshmangwani commentedon Aug 12, 2024
Regression Test Proposal
Precondition: Ensure the user has received an invoice.Delete Expenseoption does not appear.Do we agree 👍 or 👎
jayeshmangwani commentedon Aug 12, 2024
@CortneyOfstad Apologies for the delay; I've completed the checklist now.
CortneyOfstad commentedon Aug 14, 2024
No worries thank you! Payment summary is linked here!
Test rail regression GH linked above, so closing!
jayeshmangwani commentedon Aug 15, 2024
Requested on ND as per #45632 (comment)
JmillsExpensify commentedon Aug 21, 2024
$250 approved for @jayeshmangwani