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

[$250] Header - Header does not display "No Action Required" when payment is disabled #50785

Open
2 of 6 tasks
IuliiaHerets opened this issue Oct 15, 2024 · 17 comments
Open
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 15, 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: 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): biruknew45+1562@gmail.com
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
Issue OwnerCurrent Issue Owner: @dukenv0307
@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

@dukenv0307 this seems to be a backend bug - "No further action required." should be returned, but the message returned is empty.
If that happens however, the header should be hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Development

No branches or pull requests

7 participants