Skip to content

[HOLD for payment 2024-02-19] [$500] IOU -Deleting submitted report shows unexpected error with amount crossed out #34538

Closed

Description

@lanitochka17

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: 1.4.25
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch app
  2. Login employee account
  3. Tap on employee workspace chat
  4. Tap plus icon near compose-- request money manual
  5. Enter an amount and tap next
  6. Enter merchant field
  7. Tap request
  8. Tap submit
  9. Open submitted IOU to open IOU detail page
  10. Tap 3 dots on top right and tap delete and confirm delete request

Expected Result:

User must not be shown option/allowed to delete submitted report & error should not be displayed with amount crossed out

Actual Result:

In employee WS, create manual request and submit it. User shown option/allowed to delete submitted report and deleted report shows unexpected error with amount crossed out

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6343590_1705353673385.rep.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0165e8908305facf78
  • Upwork Job ID: 1747014776873512960
  • Last Price Increase: 2024-01-22
  • Automatic offers:
    • s77rt | Reviewer | 28134406
    • bernhardoj | Contributor | 28134407

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 15, 2024
  2. changed the title [-]IOU - Android-Deleting submitted report shows unexpected error with amount crossed out[/-] [+][$500] IOU - Android-Deleting submitted report shows unexpected error with amount crossed out[/+] on Jan 15, 2024
  3. melvin-bot commented on Jan 15, 2024

    @melvin-bot
  4. melvin-bot commented on Jan 15, 2024

    @melvin-bot

    Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 15, 2024
  6. melvin-bot commented on Jan 15, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav (External)

  7. bernhardoj commented on Jan 16, 2024

    @bernhardoj
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Deleting a submitted money request gives an error.

    What is the root cause of that problem?

    We are not hiding the delete button when the money request is submitted. We only hide it if it's approved or settled.

    const canModifyRequest = isActionOwner && !isSettled && !isApproved && !ReportActionsUtils.isDeletedAction(parentReportAction);

    What changes do you think we should make in order to solve the problem?

    We need to hide it if the money request is submitted. To know whether it's submitted or not, we can use the same check-in #32796, specifically:

    App/src/libs/ReportUtils.ts

    Lines 3815 to 3818 in 8e2fb67

    const isOwnExpenseReport = isExpenseReport(report) && isOwnPolicyExpenseChat;
    if (isOwnExpenseReport && PolicyUtils.isPaidGroupPolicy(policy)) {
    return isDraftExpenseReport(report);
    }

    We only check the submitted status (isDraftExpenseReport true means open, not submitted) in an expense report that is linked with a paid policy.

    We need to apply this check in both MoneyRequestHeader and in ReportUtils.canDeleteReportAction.

    App/src/libs/ReportUtils.ts

    Lines 1139 to 1141 in 8e2fb67

    if (isActionOwner) {
    return true;
    }

    if (isActionOwner) {
        if (isExpenseReport(report) && PolicyUtils.isPaidGroupPolicy(policy)) {
            return isDraftExpenseReport(report);
        }
        return true;
    }
    

    threeDotsMenuItems.push({
    icon: Expensicons.Trashcan,
    text: translate('reportActionContextMenu.deleteAction', {action: parentReportAction}),
    onSelected: () => setIsDeleteModalVisible(true),
    });

    if (ReportUtils.isExpenseReport(moneyRequestReport) && PolicyUtils.isPaidGroupPolicy(policy)) {
        if (ReportUtils.isDraftExpenseReport(moneyRequestReport)) {
            threeDotsMenuItems.push({
                icon: Expensicons.Trashcan,
                text: translate('reportActionContextMenu.deleteAction', {action: parentReportAction}),
                onSelected: () => setIsDeleteModalVisible(true),
            });
        }
    } else {
        threeDotsMenuItems.push({
            icon: Expensicons.Trashcan,
            text: translate('reportActionContextMenu.deleteAction', {action: parentReportAction}),
            onSelected: () => setIsDeleteModalVisible(true),
        });
    }
    
  8. 0xmiroslav commented on Jan 18, 2024

    @0xmiroslav
    Contributor

    @sakluger once submitted (but not approved yet), request should not be deletable? I believe so but just to confirm

  9. melvin-bot commented on Jan 22, 2024

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  10. sakluger commented on Jan 23, 2024

    @sakluger
    Contributor

    I'm checking on correct expected behavior in Slack: https://expensify.slack.com/archives/C02MW39LT9N/p1706052284329559

  11. 35 remaining items

  12. changed the title [-][$500] IOU -Deleting submitted report shows unexpected error with amount crossed out[/-] [+][HOLD for payment 2024-02-19] [$500] IOU -Deleting submitted report shows unexpected error with amount crossed out[/+] on Feb 12, 2024
  13. melvin-bot commented on Feb 12, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. melvin-bot commented on Feb 12, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.39-8 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-02-19. 🎊

    For reference, here are some details about the assignees on this issue:

  15. melvin-bot commented on Feb 12, 2024

    @melvin-bot

    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:

    • [@s77rt] The PR that introduced the bug has been identified. Link to the PR:
    • [@s77rt] 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:
    • [@s77rt] 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:
    • [@s77rt] Determine if we should create a regression test for this bug.
    • [@s77rt] 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.
    • [@sakluger] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  16. s77rt commented on Feb 13, 2024

    @s77rt
    Member
    • The PR that introduced the bug has been identified: This seems to be a bug since day one, Add DeleteMoneyRequest #19095
    • The offending PR has been commented on: Add DeleteMoneyRequest #19095 (comment)
    • A discussion in #expensify-bugs has been started: Not needed. More like a onetime bug
    • Determine if we should create a regression test for this bug: Yes

    Regression Test Proposal

    Requires a paid workspace e.g. collect workspace

    1. Login as an employee
    2. Create a new money request
    3. Submit the expense report
    4. Go to the money request and Verify you cannot delete it
    5. Login as an admin
    6. Go to the money request and Verify you can delete it
  17. sakluger commented on Feb 20, 2024

    @sakluger
    Contributor

    Thanks @s77rt for completing the BZ checklist ahead of time!

    Everyone has been paid out. 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions