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-11-13] [$250] Header - Header does not display "No Action Required" when payment is disabled #50785

Closed
2 of 6 tasks
IuliiaHerets opened this issue Oct 15, 2024 · 40 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

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 15, 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.49-0
Reproducible in staging?: Y
Reproducible in production?: Y
Issue was found when executing this PR: #49837
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com.
  2. Navigate to Workspace and enable Workflows.
  3. Disable payments.
  4. Submit an expense in the workspace chat.
  5. Go offline and click on the expense preview.

Expected Result:

The header should display "No further action required."

Actual Result:

The header displays "Waiting for your expense(s) to automatically submit."

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6635003_1728981428894.1__1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021848784178852136813
  • Upwork Job ID: 1848784178852136813
  • Last Price Increase: 2024-10-22
  • Automatic offers:
    • dukenv0307 | Reviewer | 104641561
    • NJ-2020 | Contributor | 104641563
Issue OwnerCurrent Issue Owner: @OfstadC
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 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.

@IuliiaHerets
Copy link
Author

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

@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 15, 2024

Edited by proposal-police: This proposal was edited at 2024-10-16 03:35:57 UTC.

Proposal

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

Header - Header does not display "No Action Required" when payment is disabled

What is the root cause of that problem?

When we create the next step header for the expense, we pass STATUS_NUM.OPEN for the predictedNextStatus

const optimisticNextStep = NextStepUtils.buildNextStep(iouReport, CONST.REPORT.STATUS_NUM.OPEN);

case CONST.REPORT.STATUS_NUM.OPEN:
// Self review
optimisticNextStep = {
type,
icon: CONST.NEXT_STEP.ICONS.HOURGLASS,
message: [
{
text: 'Waiting for ',
},
{
text: `${ownerDisplayName}`,
type: 'strong',
clickToCopyText: ownerAccountID === currentUserAccountID ? currentUserEmail : '',
},
{
text: ' to ',
},
{
text: 'add',
},
{
text: ' %expenses.',
},
],
};
// Scheduled submit enabled
if (harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL) {
optimisticNextStep.message = [
{
text: 'Waiting for ',

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

We should check if the policy?.reimbursementChoice is no CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO then we will pass STATUS_NUM.CLOSED

const optimisticNextStep = NextStepUtils.buildNextStep(
    iouReport,
    policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO ? CONST.REPORT.STATUS_NUM.CLOSED : CONST.REPORT.STATUS_NUM.OPEN,
);

Result

Screen.Recording.2024-10-15.at.06.10.29.mov

What alternative solutions did you explore? (Optional)

We can also hide the next step header when the reimbursementChoice is no as the backend return empty next step when the reimbursementChoice is no

const optimisticNextStep = policy?.reimbursementChoice === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO ? null : NextStepUtils.buildNextStep(
    iouReport,
    CONST.REPORT.STATUS_NUM.OPEN,
);

@OfstadC
Copy link
Contributor

OfstadC commented Oct 15, 2024

Can't reproduce. I don't get a header at all
image

image

@OfstadC
Copy link
Contributor

OfstadC commented Oct 15, 2024

Got in on the second try
image

@daledah
Copy link
Contributor

daledah commented Oct 15, 2024

Proposal

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

  • The header displays "Waiting for your expense(s) to automatically submit."

What is the root cause of that problem?

  • When creating an expense, we always optimistically set the next step, assuming it will be CONST.REPORT.STATUS_NUM.OPEN, without accounting for the case where policy?.reimbursementChoice === 'reimburseNo':

const optimisticNextStep = NextStepUtils.buildNextStep(iouReport, CONST.REPORT.STATUS_NUM.OPEN);

  • However, the backend returns an empty next step when policy?.reimbursementChoice === 'reimburseNo'.

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

  • Update:

const optimisticNextStep = NextStepUtils.buildNextStep(iouReport, CONST.REPORT.STATUS_NUM.OPEN);

to:

    const optimisticNextStep = policy?.reimbursementChoice === 'reimburseNo' ? null : NextStepUtils.buildNextStep(iouReport, CONST.REPORT.STATUS_NUM.OPEN);

to make sure our optimistic data will match BE data.

What alternative solutions did you explore? (Optional)

  • Instead of set the optimistic next step to null like above, we can set it to:
{
    message: [],
    title: 'Next Step:',
    requiresUserAction: false,
    nextReceiver: '',
    showForExpense: true,
    showForMobile: true,
    showUndoSubmit: false
}

@daledah
Copy link
Contributor

daledah commented Oct 15, 2024

@OfstadC Can you confirm whether the expected behavior is: The header should display "No further action required."

Because, in online mode, there is no header is displayed.

@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 16, 2024

Proposal Updated

@abzokhattab
Copy link
Contributor

I think this is a regression from #49837

Copy link

melvin-bot bot commented Oct 21, 2024

@OfstadC Eep! 4 days overdue now. Issues have feelings too...

@OfstadC OfstadC added the External Added to denote the issue can be worked on by a contributor label Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

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

@melvin-bot melvin-bot bot changed the title Header - Header does not display "No Action Required" when payment is disabled [$250] Header - Header does not display "No Action Required" when payment is disabled Oct 22, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 22, 2024
Copy link

melvin-bot bot commented Oct 22, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Oct 22, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Oct 22, 2024

The header shouldn't say "waiting to automatically submit..." since it's already been submitted. 😅

@dukenv0307
Copy link
Contributor

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 23, 2024

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

@dukenv0307
Copy link
Contributor

@mjasikowski @OfstadC I want to confirm the expectation here:

When creating the expense, we build the optimistic data for reportNextStep

const optimisticNextStep = NextStepUtils.buildNextStep(iouReport, CONST.REPORT.STATUS_NUM.OPEN);

and it's Waiting for your expense(s) to automatically submit.

Screenshot 2024-10-23 at 15 54 42

But BE returns the empty message, so the header doesn't show anything

Screenshot 2024-10-23 at 15 48 10

So what is the expectation here:

  1. Header shows No further action required. (in the requirement)
  2. Nothing is shown (like what BE returns)

@mjasikowski
Copy link
Contributor

Let's go with @NJ-2020 proposal then!

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

melvin-bot bot commented Oct 29, 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 Oct 29, 2024

📣 @NJ-2020 🎉 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 📖

Copy link

melvin-bot bot commented Oct 29, 2024

@mjasikowski @OfstadC @NJ-2020 @dukenv0307 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 30, 2024
@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 30, 2024

PR ready
cc: @dukenv0307

@dukenv0307
Copy link
Contributor

dukenv0307 commented Oct 30, 2024

Screenshot 2024-10-30 at 22 06 13

@mjasikowski @NJ-2020 BE returns the Waiting for your expense(s) to automatically submit messages (The correct message are No further action required.). Should we hold the issue for BE fix? IMO, the PR fix on FE side can be merged first

@mjasikowski
Copy link
Contributor

I'll take a look and see if I can prepare a backend fix

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 6, 2024
@melvin-bot melvin-bot bot changed the title [$250] Header - Header does not display "No Action Required" when payment is disabled [HOLD for payment 2024-11-13] [$250] Header - Header does not display "No Action Required" when payment is disabled Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 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 Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

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

Copy link

melvin-bot bot commented Nov 6, 2024

@dukenv0307 @OfstadC 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]

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 6, 2024

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
  • 2b. Reported on staging (deploy blocker)
  • 2c. 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: There's no offending PR

  • [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: N/A

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

Regression Test Proposal Template

Regression Test Proposal

Test:

  1. Go to staging.new.expensify.com.
  2. Navigate to Workspace and enable Workflows.
  3. Disable payments (Make or track payments option)
  4. Submit an expense in the workspace chat.
  5. Go offline and click on the expense preview.
  6. Make sure the header displays "No further action required."

Do we agree 👍 or 👎

@OfstadC
Copy link
Contributor

OfstadC commented Nov 6, 2024

Thanks @dukenv0307 !

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 12, 2024
@OfstadC
Copy link
Contributor

OfstadC commented Nov 12, 2024

Will issue payment tomorrow

@OfstadC
Copy link
Contributor

OfstadC commented Nov 13, 2024

@OfstadC
Copy link
Contributor

OfstadC commented Nov 13, 2024

Payment Summary

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
Development

No branches or pull requests

7 participants