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-08-09] [$250] Approved expenses are showing pinned expenses with RBR #45230

Closed
6 tasks
m-natarajan opened this issue Jul 11, 2024 · 31 comments
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

@m-natarajan
Copy link

m-natarajan commented Jul 11, 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:
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
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: @dubielzyk-expensify
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1720606818055389

Action Performed:

  1. Created expenses with tags departments
  2. The report was approved
  3. After a while Tags Departments does not exist or deleted
  4. Log in to the app
  5. Observe the LHN

Expected Result:

Approved expenses shouldn't have an RBR red dot in the LHN, nor should the expense be pinned.

Actual Result:

Approved expenses are showing with RBR red dot in the LHN, and the expense is pinned.

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

CleanShot 2024-07-10 at 20 20 59@2x

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b843922542221f31
  • Upwork Job ID: 1811554062884646329
  • Last Price Increase: 2024-07-19
  • Automatic offers:
    • situchan | Reviewer | 103243092
    • dominictb | Contributor | 103243093
Issue OwnerCurrent Issue Owner: @trjExpensify
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 11, 2024
Copy link

melvin-bot bot commented Jul 11, 2024

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

@trjExpensify
Copy link
Contributor

confirming in thread: https://expensify.slack.com/archives/C049HHMV9SM/p1720606818055389

Seems weird Jon hasn't been paid since Jan 2024. 🤔

@trjExpensify
Copy link
Contributor

Alright, Jon confirmed the history doesn't contain any previous reimbursement reportAction. The report was only approved on Jan 27th.

@trjExpensify
Copy link
Contributor

I can repro this pretty easily.

  1. Enable "category required" on the workspace
  2. Submit a couple of expenses without categories
  3. Approve the expense report
  4. Observe the two expenses remain pinned in the LHN with a red dot
image

I took it further to pay the expense report and the red dots and pinning are removed when paid, which we expect:

image

CC: @JmillsExpensify I think we put this one in #wave-control as violations polish. Putting it there, but let me know if you disagree with that.

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

melvin-bot bot commented Jul 12, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01b843922542221f31

@melvin-bot melvin-bot bot changed the title Approved expenses are showing pinned expenses with RBR [$250] Approved expenses are showing pinned expenses with RBR Jul 12, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 12, 2024
Copy link

melvin-bot bot commented Jul 12, 2024

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

@dominictb
Copy link
Contributor

dominictb commented Jul 12, 2024

Proposal

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

Approved expenses are showing with RBR red dot in the LHN, and the expense is pinned.

What is the root cause of that problem?

In

if (isSettled(IOUReportID)) {
, we check only if IOUReport is settled to not show the violations. So when the report is approved but not settled, it will still show violations and RBR.

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

Update

if (isSettled(IOUReportID)) {
so that it also early returns if the IOU report has been approved, we can use isReportApproved for this.

When using isReportApproved here, make sure to use toString like

if (isSettled(IOUReportID) || isReportApproved(IOUReportID?.toString())) {

Because IOUReportID could be number (BE data) while we're expecting string here. Ideally though, the back-end should be fixed to have IOUReportID as string.

What alternative solutions did you explore? (Optional)

Add !isReportApproved condition here

const shouldDisplayViolations = canUseViolations && ReportUtils.shouldDisplayTransactionThreadViolations(fullReport, transactionViolations, parentReportAction);

(below is not needed according to this)
Additional:

so I'd expect the RBR on the expense report here.

As of now the expense report will not have the RBR in this case, if we want the RBR to show there, we need to update here to check if it's a "REPORTPREVIEW" then find all transaction threads of that IOU report, if any of those transaction threads have shouldDisplayTransactionThreadViolations true, return true in shouldDisplayTransactionThreadViolations for the IOU report.

@situchan
Copy link
Contributor

@trjExpensify we wanna remove RBR from transaction detail reports (1, 3) in LHN but still show RBR in expense report (2)?

image

@trjExpensify
Copy link
Contributor

Yeah, in this case, my report has failed to export after being approved (the state in which we export if you aren't paying in Expensify) and that's something I need to fix in order to export to QuickBooks successfully, so I'd expect the RBR on the expense report here.

Copy link

melvin-bot bot commented Jul 15, 2024

@trjExpensify, @situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

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

@situchan what do you think of the proposal?

Copy link

melvin-bot bot commented Jul 17, 2024

@trjExpensify, @situchan Eep! 4 days overdue now. Issues have feelings too...

@situchan
Copy link
Contributor

updating today

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2024
@situchan
Copy link
Contributor

@dominictb I am still seeing RBR after replacing isSettled with isReportApproved

Copy link

melvin-bot bot commented Jul 19, 2024

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

@dominictb
Copy link
Contributor

dominictb commented Jul 23, 2024

@dominictb I am still seeing RBR after replacing isSettled with isReportApproved

@situchan When using isReportApproved here, make sure to use toString like

if (isSettled(IOUReportID) || isReportApproved(IOUReportID?.toString())) {

Because IOUReportID could be number (BE data) while we're expecting string here. Ideally though, the back-end should be fixed to have IOUReportID as string.

Let me know if that works!

@melvin-bot melvin-bot bot added the Overdue label Jul 23, 2024
@dominictb
Copy link
Contributor

Proposal updated with additional notes

Copy link

melvin-bot bot commented Jul 23, 2024

@trjExpensify, @situchan Eep! 4 days overdue now. Issues have feelings too...

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

melvin-bot bot commented Jul 24, 2024

📣 @situchan 🎉 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

Copy link

melvin-bot bot commented Jul 24, 2024

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 25, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 2, 2024
@melvin-bot melvin-bot bot changed the title [$250] Approved expenses are showing pinned expenses with RBR [HOLD for payment 2024-08-09] [$250] Approved expenses are showing pinned expenses with RBR Aug 2, 2024
Copy link

melvin-bot bot commented Aug 2, 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 Aug 2, 2024
Copy link

melvin-bot bot commented Aug 2, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.15-9 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-08-09. 🎊

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

Copy link

melvin-bot bot commented Aug 2, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Aug 8, 2024
@trjExpensify
Copy link
Contributor

Checklist time!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 9, 2024
@techievivek
Copy link
Contributor

Gentle bump @situchan

Copy link

melvin-bot bot commented Aug 12, 2024

@trjExpensify, @techievivek, @situchan, @dominictb Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@situchan
Copy link
Contributor

Regression Test Proposal

  1. Create an expense with violation (i.e. no category or no tag)
  2. Approve the report
  3. Go to transaction detail
  4. Observe the LHN
  5. Verify that report doesn't have an RBR red dot in the LHN and isn't pinned

@trjExpensify
Copy link
Contributor

Payment summary as follows:

Paid!

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
Status: Done
Development

No branches or pull requests

5 participants