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 2025-02-07] [$250] Users can't submit a report that contains no reimbursable expenses #55086

Closed
8 tasks done
trjExpensify opened this issue Jan 10, 2025 · 48 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

@trjExpensify
Copy link
Contributor

trjExpensify commented Jan 10, 2025

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?: Y
Reproducible in production?: Y
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: @danielrvidal
Slack conversation (hyperlinked to channel name): #retain

Action Performed:

  1. Go to NewDot, create a workspace.
  2. Go to Settings > Workspaces > [Click the workspace] > Enable Workflows
  3. Go to Workflows > Enable delayed submission and set it to Manually > Enable approvals.
  4. Go to Members > invite a member to the workspace
  5. [Member] Click the green plus icon > Create expense > choose the workspace > confirm
  6. Observe the Submit button on the report preview, in the report header, and on the search page.
  7. [Member] Click Settings > Domains (to transition over to OldDot)
  8. [Member] Go to the Expenses page > click into the expense > uncheck the reimbursable checkmark
  9. [Member] open the NewDot tab > refresh
  10. Observe the Submit button is no longer visible on the report preview, report header or search page.

Expected Result:

Users should be able to see the Submit button on an expense report that contains only non-reimbursable expenses, providing they aren't all pending transactions.

Actual Result:

There's no Submit button on an expense report that contains only non-reimbursable expenses.

Note: I think this line here is culprit. Perhaps it's also in a few other places where you see the submit button.

Workaround:

They can submit via OldDot.

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-01-10_18-28-51.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021877786460553153940
  • Upwork Job ID: 1877786460553153940
  • Last Price Increase: 2025-01-10
  • Automatic offers:
    • shubham1206agra | Contributor | 105671141
    • ishpaul777 | Contributor | 105671147
Issue OwnerCurrent Issue Owner: @trjExpensify
@trjExpensify trjExpensify added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 10, 2025
@trjExpensify trjExpensify self-assigned this Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

Current assignee @trjExpensify is eligible for the Bug assigner, not assigning anyone new.

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Jan 10, 2025
@melvin-bot melvin-bot bot changed the title Users can't submit a report that contains no reimbursable expenses [$250] Users can't submit a report that contains no reimbursable expenses Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

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

@trjExpensify trjExpensify moved this to Product (CRITICAL) in [#whatsnext] #retain Jan 10, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

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

@allroundexperts
Copy link
Contributor

@trjExpensify Your clue is accurate.

@allroundexperts
Copy link
Contributor

allroundexperts commented Jan 10, 2025

We need to remove the condition here in the money report header as well. There's also a condition in the submission action that we need to remove.

@allgandalf
Copy link
Contributor

@trjExpensify Your clue is accurate.

@trjExpensify is gonna take our job away !!!!!

@allroundexperts
Copy link
Contributor

Haha ❤️

@mohit6789
Copy link
Contributor

Proposal

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

Users can't submit a report that contains no reimbursable expenses

What is the root cause of that problem?

Button only show in case of reimbursableSpend != 0 as mention by @trjExpensify.

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

We need to make sure button is showing in case of reimbursableSpend is 0. For this we need to remove reimbursableSpend !== 0 condition in this three places.

https://github.com/allroundexperts/Expensify/blob/3b665f7ff38fc7b3b7155e84eb0d09e680742a82/src/components/MoneyReportHeader.tsx#L149

https://github.com/allroundexperts/Expensify/blob/3b665f7ff38fc7b3b7155e84eb0d09e680742a82/src/libs/actions/IOU.ts#L7408

reimbursableSpend !== 0 &&

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

@allroundexperts
Copy link
Contributor

Proposal

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

Users can't submit a report that contains no reimbursable expenses

What is the root cause of that problem?

As stated by @trjExpensify, we have this line that prevents the submit button from appearing if the expense is not reimbursable.

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

We need to remove the conditions that block submission if the expense is not reimbursable. Particularly, we need to remove the condition here, here and here.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Adding a regression test for submitting a non reimbursable expense should suffice.

What alternative solutions did you explore? (Optional)

N/A

@twilight2294
Copy link
Contributor

Proposal

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

Users can't submit a report that contains no reimbursable expenses

What is the root cause of that problem?

We only check for reimbursableSpend !== 0:

reimbursableSpend !== 0 &&

This causes the button to be hidden

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

We need to update the condition such that it will not show only when the reimbursible - non-reimbursible = 0:

    const shouldShowSubmitButton =
        isOpenExpenseReport &&
        (reimbursableSpend - nonReimbursableSpend) !== 0 &&

We need to update other places as well here and here

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Jan 10, 2025

Edited by proposal-police: This proposal was edited at 2025-01-10 19:14:25 UTC.

Proposal

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

Users can't submit a report that contains no reimbursable expenses

What is the root cause of that problem?

As stated by @trjExpensify, we have this line that prevents the submit button from appearing if the expense is not reimbursable. We should have checked for totalSpend instead of reimbursableSpend.

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

We need to update the conditions that block submission if the expense is not reimbursable. Particularly, we need to update the condition here, here and here.

The updated condition should be totalDisplaySpend !== 0 to check for total spend instead of reimbursable spend in case of the submit button.

Note

We should also check conditions for approvals too for the same problem.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Adding a regression test for submitting a non reimbursable expense should suffice.

What alternative solutions did you explore? (Optional)

N/A

@allroundexperts
Copy link
Contributor

allroundexperts commented Jan 10, 2025

The updated condition should be totalDisplaySpend !== 0 to check for total spend instead of reimbursable spend in case of the submit button.

Can we have a case @shubham1206agra where a money report is created and it has a 0 spend?

@allroundexperts
Copy link
Contributor

Ah, I see. If a scan fails, then the total spend would be 0 unless entered manually. Till its entered, we shouldn't show the submit button. Adding totalDisplaySpend is better. 👍

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jan 10, 2025

taking over c+ role https://expensify.slack.com/archives/C02NK2DQWUX/p1736539732521579?thread_ts=1736534208.861619&cid=C02NK2DQWUX

@shubham1206agra's proposal makes sense to me a works as expected.

🎀 👀 🎀

Copy link

melvin-bot bot commented Jan 10, 2025

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

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jan 10, 2025

We should also check conditions for approvals too for the same problem.

can you please list test steps for such cases @shubham1206agra

@twilight2294
Copy link
Contributor

taking over c+ role https://expensify.slack.com/archives/C02NK2DQWUX/p1736539732521579?thread_ts=1736534208.861619&cid=C02NK2DQWUX

@shubham1206agra's proposal makes sense to me a works as expected.

🎀 👀 🎀

@lakchote @ishpaul777 In my proposal i used reimbursableSpend - nonReimbursableSpend because it is more readable and easy to understand the condition when shouldShowSubmitButton should be true :)) , both the proposals are going to yield the same result , so can you re-review the proposal please

@melvin-bot melvin-bot bot added the Overdue label Jan 13, 2025
@shubham1206agra
Copy link
Contributor

taking over c+ role https://expensify.slack.com/archives/C02NK2DQWUX/p1736539732521579?thread_ts=1736534208.861619&cid=C02NK2DQWUX
@shubham1206agra's proposal makes sense to me a works as expected.
🎀 👀 🎀

@lakchote @ishpaul777 In my proposal i used reimbursableSpend - nonReimbursableSpend because it is more readable and easy to understand the condition when shouldShowSubmitButton should be true :)) , both the proposals are going to yield the same result , so can you re-review the proposal please

Haha what?? @twilight2294 I think you used wrong notation here. I think what you meant to do is reimbursableSpend + nonReimbursableSpend instead of current one. Current one will cause problem when both reimbursable and non reimbursable spends are equal.

Copy link

melvin-bot bot commented Jan 13, 2025

Current assignee @lakchote is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@shubham1206agra
Copy link
Contributor

Yeah completing checklist right now.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 27, 2025
Copy link

melvin-bot bot commented Jan 30, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 31, 2025
@melvin-bot melvin-bot bot changed the title [$250] Users can't submit a report that contains no reimbursable expenses [HOLD for payment 2025-02-07] [$250] Users can't submit a report that contains no reimbursable expenses Jan 31, 2025
Copy link

melvin-bot bot commented Jan 31, 2025

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 31, 2025
Copy link

melvin-bot bot commented Jan 31, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.92-6 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 2025-02-07. 🎊

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

Copy link

melvin-bot bot commented Jan 31, 2025

@shubham1206agra / @ishpaul777 @trjExpensify @shubham1206agra / @ishpaul777 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Feb 6, 2025
@ishpaul777
Copy link
Contributor

ishpaul777 commented Feb 6, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: https://github.com/Expensify/App/pull/51012/files#r1945412669

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: Not required

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. yes

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

N/a

Test:

  1. Go to NewDot, create a workspace.
  2. Go to Settings > Workspaces > [Click the workspace] > Enable Workflows
  3. Go to Workflows > Enable delayed submission and set it to Manually > Enable approvals.
    4.Go to Members > invite a member to the workspace
  4. [Member] Click the green plus icon > Create expense > choose the workspace > confirm
  5. Observe the Submit button on the report preview, in the report header, and on the search page.
  6. [Member] Click Settings > Domains (to transition over to OldDot)
  7. [Member] Go to the Expenses page > click into the expense > uncheck the reimbursable checkmark
  8. [Member] open the NewDot tab > refresh
    Expected Result:
    Users should be able to see the Submit button on an expense report preview, report header or search page, providing they aren't all pending transactions.

Do we agree 👍 or 👎

@trjExpensify
Copy link
Contributor Author

Regression test request created.

Payment summary as follows:

Confirming you're both paid via Upwork still?

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2025
@shubham1206agra
Copy link
Contributor

@trjExpensify For this issue, yes

Copy link

melvin-bot bot commented Feb 10, 2025

@trjExpensify, @lakchote, @shubham1206agra, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Feb 10, 2025
@ishpaul777
Copy link
Contributor

yes still via upwork

@trjExpensify
Copy link
Contributor Author

Great stuff! @ishpaul777 I've paid you, @shubham1206agra you need to accept the offer.

@melvin-bot melvin-bot bot removed the Overdue label Feb 10, 2025
@shubham1206agra
Copy link
Contributor

@trjExpensify Offer accepted

@trjExpensify
Copy link
Contributor Author

Paid, closing!

@github-project-automation github-project-automation bot moved this from CRITICAL to DONE in [#whatsnext] #retain Feb 11, 2025
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

9 participants