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-06-06] [$250] Wrong "Next step" displayed for the approver #41614

Closed
1 of 6 tasks
m-natarajan opened this issue May 3, 2024 · 22 comments
Closed
1 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

@m-natarajan
Copy link

m-natarajan commented May 3, 2024

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.70-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: @JmillsExpensify
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1714518611299619

Action Performed:

Prerequisite: Have a collect workspace with admin, approver, and employee.

  1. Employee submits report to approver
  2. Approver approves the report
  3. Observe the next step header for approver

Expected Result:

"Waiting for you to pay these expenses" should not be displayed for the approver

Actual Result:

"Waiting for you to pay these expenses" is displayed for approver who is not configured to pay the report

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

CleanShot 2024-04-30 at 17 09 15@2x

pay.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e9b6cf8e506af2ea
  • Upwork Job ID: 1787692015561465856
  • Last Price Increase: 2024-05-07
  • Automatic offers:
    • dukenv0307 | Reviewer | 0
Issue OwnerCurrent Issue Owner: @adelekennedy
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 3, 2024
Copy link

melvin-bot bot commented May 3, 2024

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

@cretadn22
Copy link
Contributor

Proposal

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

Payer is wrong in the header

What is the root cause of that problem?

When an employee creates a money request, the backend returns a request report where the managerID is the ID of the approver

if (!isOwner) {
optimisticNextStep.message = [
{
text: 'Waiting for ',
},
{
text: managerDisplayName,
type: 'strong',

Given that managerDisplayName is "you"

If I understand correctly:

  • ownerID corresponds to the ID of the request creator
  • managerID corresponds to the ID of the workspace admin

If this understanding is accurate, then the current logic here is wrong

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

We need to extract the approverID from the policy using approverID = policy.submitsTo. Then

  • If the current user is the approver, we'll show "you"
  • If the current user isn't the approver, we'll display the name of the approver

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Copy link

melvin-bot bot commented May 7, 2024

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

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label May 7, 2024
@melvin-bot melvin-bot bot changed the title Wrong "Next step" displayed for the approver [$250] Wrong "Next step" displayed for the approver May 7, 2024
Copy link

melvin-bot bot commented May 7, 2024

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

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

melvin-bot bot commented May 7, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label May 7, 2024
@adelekennedy
Copy link

@dukenv0307 just one proposal to review so far

@dominictb
Copy link
Contributor

dominictb commented May 7, 2024

Proposal

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

"Waiting for you to pay these expenses" is displayed for approver who is not configured to pay the report

What is the root cause of that problem?

The logic we have here is wrong, in this case there's no further action required from the approver so the message shown is incorrect

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

Since there's no further action required from the approver in this case, we can update this to the No further action required! next step like in here, this is also consistent with what the back-end returns.

Or we can use the no action required message for the whole block here (except the case where the current user is the payer of the request too)

What alternative solutions did you explore? (Optional)

Early return No further action required! next step in here if the current user cannot pay the request (eg. Is not one of the workspace admins, the full condition for checking if user can pay the request is here and !ReportUtils.isInvoiceReport here)

@dukenv0307
Copy link
Contributor

starting review now

@dukenv0307
Copy link
Contributor

I like @dominictb's alternative solution

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented May 8, 2024

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

@trjExpensify
Copy link
Contributor

@mountiny fancy giving this proposal a review?

@mountiny mountiny assigned mountiny and dominictb and unassigned flodnv May 8, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 8, 2024
Copy link

melvin-bot bot commented May 8, 2024

📣 @dukenv0307 🎉 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 May 8, 2024

📣 @dominictb You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@mountiny
Copy link
Contributor

mountiny commented May 8, 2024

Happy to take this over from Flo as I have worked on the next steps before.

@dominictb Your alternative solution looks better. When the isOwner condition was implemented, we still did not have the policy reimburser data in the App or policy settings. Now, we should use the method you have mentioned in the alternative solutions or the isPayer logic, needs to be checked thoroughly. This should ensure the payer will get this message correctly.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels May 13, 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 May 30, 2024
@melvin-bot melvin-bot bot changed the title [$250] Wrong "Next step" displayed for the approver [HOLD for payment 2024-06-06] [$250] Wrong "Next step" displayed for the approver May 30, 2024
Copy link

melvin-bot bot commented May 30, 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 May 30, 2024
Copy link

melvin-bot bot commented May 30, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.77-11 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-06-06. 🎊

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

Copy link

melvin-bot bot commented May 30, 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:

  • [@dukenv0307] The PR that introduced the bug has been identified. Link to the PR:
  • [@dukenv0307] 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:
  • [@dukenv0307] 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:
  • [@dukenv0307] Determine if we should create a regression test for this bug.
  • [@dukenv0307] 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.
  • [@adelekennedy] 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 and removed Weekly KSv2 labels Jun 6, 2024
@adelekennedy
Copy link

@dominictb do you mind applying to the job here so I can pay you out? Thank you!!

@adelekennedy
Copy link

@dominictb accepted

@dominictb
Copy link
Contributor

@adelekennedy Offer accepted, thanks

@adelekennedy
Copy link

payments made! @dukenv0307 do we need a regression test here?

@dukenv0307
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: N/A
  • 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: N/A
  • 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: N/A
  • Determine if we should create a regression test for this bug. N/A
  • 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. N/A

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
No open projects
Archived in project
Development

No branches or pull requests

8 participants