-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expense - Error when deleting expense when Delay submissions is enabled #49157
Comments
Triggered auto assignment to @flodnv ( |
Triggered auto assignment to @trjExpensify ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The expense is not deleted and error shows up. What is the root cause of that problem?
In Lines 1668 to 1683 in 00bc167
We see that when WS has Delayed submission, App/src/pages/ReportDetailsPage.tsx Line 202 in 00bc167
becomes
This is expected, as in
transaction doesn't have What changes do you think we should make in order to solve the problem?Update Line 1674 in 00bc167
to if (!PolicyUtils.isInstantSubmitEnabled(policy) && PolicyUtils.isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(moneyRequestReport?.reportID)) { So that the Delete options is hidden when WS has delayed submission What alternative solutions did you explore? (Optional) |
Hmmm, this solution implies that the owner also won't be able to delete the transaction, which I think is wrong? |
@flodnv I don't really understand the BE logic, in #46762 (comment) I see that admin can delete employee's expenses, but not when the WS has delayed submission? What's the exact behavior here? I will update my proposal when I have the correct behavior. |
Logs FYI the email provided in the OP seems incorrect, the correct one should be applausetester+kh11090001@applause.expensifail.com
So this means we prevent admins from deleted unsubmitted expenses, which I think is correct. So we should update the logic to hide the button for the admin as we have in prod. |
@daledah I think we need to add an extra condition of report is in the open state or not with App/src/pages/ReportDetailsPage.tsx Line 202 in 478611c
(isPolicyAdmin && !ReportUtils.isOpenExpenseReport(moneyRequestReport)) |
Following the blame, pulling this one out to #wave-control for a second: https://expensify.slack.com/archives/C06ML6X0W9L/p1726235265572009 |
So I'm not sure where this came from, wires must have been crossed, but to confirm on the expected behaviour... Admins should not be able to delete other people's expenses in NewDot. They can delete their own, but for others, they can put them on hold, not delete them. So please can we revert whatever made that possible in all places;
Thanks! |
Probably this PR? #48998 |
I think we should revert #48998 and then work on a backend fix to prevent admins from being able to delete someone else's expenses. |
Revert here #49178 |
Yes @luacmartins, bcoz as per the confirmation by @dylanexpensify we allowed admin to delete the expenses. But as it seems to be wrong behavior we need to revert the PR as you suggested. |
I looked at the backend logic and I'm not sure why the search page would return |
Regardless, once the CP is done this is no longer an App blocker since the backend logic hasn't changed in a while |
Hmmm IIRC, admins can delete (remove) expenses from reports in order to not approve them -- of course, that was before we implemented "hold". |
Yeah, we don't have that concept in NewDot. |
This is fixed on staging. The Search part is still an issue, so I'll keep the original issue open since we still need to address that. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.34-2
Reproducible in staging?: Y
Reproducible in production?: N/A - no delete option in Admin side
Issue was found when executing this PR: #48998
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team
Action Performed:
Precondition:
Expected Result:
The expense should be deleted because delete option is present.
On prod, delete option is not available.
Actual Result:
The expense is not deleted and error shows up.
Also, when selecting the same expense in Search, there is no delete option from the dropdown but it is present in the transaction thread.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6601953_1726210847476.20240913_145443.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: