Skip to content

Incorrect error message when deleting an approved expense #58463

@infinite-persistence

Description

@infinite-persistence

Version Number: 2496dfa
Reproducible in staging?: Yes
Reproducible in production?:
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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:
Slack conversation (hyperlinked to channel name):

Action Performed:

  1. Create and submit expense from Account-A.
  2. Have an admin approve that expense.
  3. Make Account-A delete that expense.

Expected Result:

Should tell the user why the expense cannot be deleted, as shown in the API response. Even the API response is quite vague -- perhaps it should say "Approved expenses cannot be deleted, unless unapproved".

{
    "code": 666,
    "jsonCode": 404,
    "type": "Expensify\\Error\\Transaction\\CantReportTransactions",
    "UUID": "<redacted>",
    "message": "You do not have the permissions required to delete expenses from this report.",
    "title": "Cannot Remove Expenses",
    "data": [],
    "htmlMessage": "",
    "onyxData": [],
    "requestID": "<redacted>"
}

Actual Result:

"Unexpected error deleting this expense. Please try again later." is shown, but this statement is not true (no point retrying).

Workaround:

None. As a user, I kept re-trying to no avail.

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

2025.03.14.17.43--approved.mp4

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions