Skip to content

[HOLD for payment 2024-07-26] [$250] Hold - Red dot remains when unhold expense #45064

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: 9.0.5-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4700894&group_by=cases:section_id&group_id=309128&group_order=asc
Email or phone of affected tester (no customers): gocemate+workspaceapprover135@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

Preconditions:

  1. Login as the owner of the workspace
  2. Create a workspace
  3. Invite the approver and employee
  4. Navigate to more features
  5. Enable "workflows"
  6. On the "Workflow" editor - enable "Add Approvals"
  7. Set the Approver account as the Approver
    Steps:
  8. As Employee submit 2 expenses to Workspace chat
  9. As Approver hold the first expense
  10. As Approver go back to the expenses page ( there is red dot on the expense that is on Hold)
  11. As Approver go back to transaction thread> Unhold the expense
  12. As Approver go back to expenses page

Expected Result:

There should be no red dot on the unheld expense

Actual Result:

Red dot remains when approver unhold expense

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

Bug6536079_1720455823531.Recording__3457.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01785e48b0c37e8c52
  • Upwork Job ID: 1810949376048189607
  • Last Price Increase: 2024-07-10
  • Automatic offers:
    • paultsimura | Reviewer | 103143168
Issue OwnerCurrent Issue Owner: @dylanexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 9, 2024
  2. melvin-bot commented on Jul 9, 2024

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (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.

  3. lanitochka17 commented on Jul 9, 2024

    @lanitochka17
    Author

    @dylanexpensify 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

  4. bernhardoj commented on Jul 9, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The hold status isn't removed immediately from the money request preview.

    What is the root cause of that problem?

    The hold status comes from the transaction.comment.hold status or the transaction violations.

    const isOnHold = TransactionUtils.isOnHold(transaction);

    const shouldShowRBR = hasNoticeTypeViolations || hasViolations || hasFieldErrors || (!isFullySettled && !isFullyApproved && isOnHold);

    When we hold, the transaction.comment.hold is set, but the transaction violations are still empty. After we reopen the transaction thread, the transaction violations are returned from the BE. When we unhold the request, we only optimistically remove the transaction.comment.hold.

    App/src/libs/actions/IOU.ts

    Lines 7041 to 7059 in bb9b486

    const optimisticData: OnyxUpdate[] = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
    value: {
    [createdReportAction.reportActionID]: createdReportAction as ReportAction,
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
    value: {
    pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
    comment: {
    hold: null,
    },
    },
    },
    ];

    So, the transaction violations (that contain hold violations) still exist, thus the money request preview still shows the hold status. Reopening the transaction thread once again will clear it.

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

    Optimistically removes the transaction violations of hold when unhold-ing a request. (and revert it when fails)

    {
        onyxMethod: Onyx.METHOD.SET,
        key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
        value: transactionViolations?.filter((violation) => violation.name !== 'hold') ?? [],
    },
    

    I also suggest to return the onyx update to clears the hold violation from the UnholdRequest API.

    (we can also optimistically add the hold violation if needed, lmk if we should do it)

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 10, 2024
  6. dylanexpensify commented on Jul 10, 2024

    @dylanexpensify
    Contributor

    moving!

  7. changed the title [-] Hold - Red dot remains when unhold expense[/-] [+][$250] Hold - Red dot remains when unhold expense[/+] on Jul 10, 2024
  8. melvin-bot commented on Jul 10, 2024

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 10, 2024
  10. melvin-bot commented on Jul 10, 2024

    @melvin-bot

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

  11. paultsimura commented on Jul 10, 2024

    @paultsimura
    Contributor

    Reviewing today 👀

  12. paultsimura commented on Jul 11, 2024

    @paultsimura
    Contributor

    The proposal by @bernhardoj looks good to me.

    🎀👀🎀 C+ reviewed

    @cead22 sorry if you're the wrong person, but IIRC you were implementing the violations initially. We should modify the BE to remove the hold violation on the UnholdRequest API endpoint (in addition to the App changes). Could you please check it?

  13. 22 remaining items

  14. melvin-bot commented on Jul 19, 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:

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

    @dylanexpensify
    Contributor

    Payment coming up!

  16. paultsimura commented on Jul 22, 2024

    @paultsimura
    Contributor

    Regression Test Proposal

    1. Create a workspace if you have none
    2. Submit at least 2 expenses to the workspace
    3. Open one of the transaction threads
    4. Click the report header and hold the transaction
    5. Go back to the expense report
    6. Verify there is an RBR on the transaction preview that you held
    7. Open the same transaction thread again and unhold the transaction
    8. Go back to the expense report
    9. Verify the RBR is gone from the said transaction preview

    Do we agree 👍 or 👎

  17. removed their assignment
    on Jul 25, 2024
  18. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 25, 2024
  19. melvin-bot commented on Jul 25, 2024

    @melvin-bot

    Triggered auto assignment to @OfstadC (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.

  20. dylanexpensify commented on Jul 25, 2024

    @dylanexpensify
    Contributor

    @OfstadC I'm heading OOO starting this afternoon, so reassigning for payment! TY!

  21. bernhardoj commented on Jul 26, 2024

    @bernhardoj
    Contributor

    Payment is due today. Requested in ND.

  22. OfstadC commented on Jul 26, 2024

    @OfstadC
    Contributor

    Payment Summary:

    @paultsimura paid $250 via Upwork
    @bernhardoj due $250 via NewDot

  23. JmillsExpensify commented on Jul 26, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

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