Skip to content
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

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

Closed
3 of 6 tasks
lanitochka17 opened this issue Jul 9, 2024 · 25 comments
Closed
3 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 9, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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): [email protected]
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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

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.

@lanitochka17
Copy link
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

@bernhardoj
Copy link
Contributor

bernhardoj commented Jul 9, 2024

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)

@dylanexpensify dylanexpensify added the External Added to denote the issue can be worked on by a contributor label Jul 10, 2024
@dylanexpensify
Copy link
Contributor

moving!

@melvin-bot melvin-bot bot changed the title Hold - Red dot remains when unhold expense [$250] Hold - Red dot remains when unhold expense Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01785e48b0c37e8c52

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

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

@paultsimura
Copy link
Contributor

Reviewing today 👀

@paultsimura
Copy link
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?

Copy link

melvin-bot bot commented Jul 11, 2024

Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Beamanator
Copy link
Contributor

I'm OOO today, hopefully @cead22 can check the comments above - if not, I'll get back to this by wednesday / thursday

@melvin-bot melvin-bot bot added the Overdue label Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

@Beamanator, @paultsimura, @dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 16, 2024
Copy link

melvin-bot bot commented Jul 16, 2024

📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot removed the Overdue label Jul 16, 2024
@cead22
Copy link
Contributor

cead22 commented Jul 16, 2024

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?

I created an issue for us to update this

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 17, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @paultsimura

@Beamanator
Copy link
Contributor

Beamanator commented Jul 17, 2024

Thanks @cead22 - I am happy to review the PR for this front end part, but also feel free to assign yourself if you want it 🙏

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 19, 2024
@melvin-bot melvin-bot bot changed the title [$250] Hold - Red dot remains when unhold expense [HOLD for payment 2024-07-26] [$250] Hold - Red dot remains when unhold expense Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.9-5 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-07-26. 🎊

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

Copy link

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

  • [@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:

@dylanexpensify
Copy link
Contributor

Payment coming up!

@paultsimura
Copy link
Contributor

paultsimura commented Jul 22, 2024

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 👎

@dylanexpensify dylanexpensify removed their assignment Jul 25, 2024
@dylanexpensify dylanexpensify added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 25, 2024
Copy link

melvin-bot bot commented Jul 25, 2024

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.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 25, 2024
@dylanexpensify
Copy link
Contributor

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

@bernhardoj
Copy link
Contributor

Payment is due today. Requested in ND.

@OfstadC
Copy link
Contributor

OfstadC commented Jul 26, 2024

Payment Summary:

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

@OfstadC OfstadC closed this as completed Jul 26, 2024
@JmillsExpensify
Copy link

$250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants