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-04-15] [$500] Task - Mark as complete button shows up on cancelled task report #37707

Closed
1 of 6 tasks
m-natarajan opened this issue Mar 5, 2024 · 32 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 Mar 5, 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.47-0
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: Applause internal team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to chat.
  3. Create a task.
  4. Click on the task.
  5. Click 3-dot menu > Delete > Delete the task.
  6. Go to the cancelled task report from LHN.

Expected Result:

Mark as complete button will not show up on cancelled task report.

Actual Result:

Mark as complete button shows up on cancelled task report. Clicking on the button leads to error.
On mweb, Android and iOS app, the button appears and disappears after opening the cancelled task 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

Bug6402230_1709602046041.bandicam_2024-03-05_06-02-11-676__3_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0142a0550498bb0d82
  • Upwork Job ID: 1765856337867956224
  • Last Price Increase: 2024-03-21
  • Automatic offers:
    • situchan | Reviewer | 0
    • dukenv0307 | Contributor | 0
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 5, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@m-natarajan
Copy link
Author

We think that this bug might be related to #vip-vsb
cc @quinthar

@m-natarajan
Copy link
Author

m-natarajan commented Mar 5, 2024

@ischurr 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.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Mar 5, 2024

Proposal

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

Mark as complete button shows up on cancelled task report. Clicking on the button leads to error.
On mweb, Android and iOS app, the button appears and disappears after opening the cancelled task report.

What is the root cause of that problem?

When we open the task report, OpenReport API is called and BE returns isDeletedParentAction as null.

Screenshot 2024-03-05 at 10 17 12

It leads to this check being true in HeaderView

{isTaskReport && !isSmallScreenWidth && ReportUtils.isOpenTaskReport(props.report) && <TaskHeaderActionButton report={props.report} />}

isTaskReport(report) && !isCanceledTaskReport(report, parentReportAction) && report?.stateNum === CONST.REPORT.STATE_NUM.OPEN && report?.statusNum === CONST.REPORT.STATUS_NUM.OPEN

because we don't pass parentReportAction into isOpenTaskReport task report as we

{ReportUtils.isTaskReport(report) && isSmallScreenWidth && ReportUtils.isOpenTaskReport(report, parentReportAction) && (

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

  1. We should pass parentReportAction from ReportScreen into HeaderView instead of getting it through getParentReportAction because HeaderView will not re-render if parentReportAction is changed.

const parentReportAction = ReportActionsUtils.getParentReportAction(props.report);

  1. pass props.parentReportAction into isOpenTaskReport here
{isTaskReport && !isSmallScreenWidth && ReportUtils.isOpenTaskReport(props.report, props.parentReportAction) && <TaskHeaderActionButton report={props.report} />} 

{isTaskReport && !isSmallScreenWidth && ReportUtils.isOpenTaskReport(props.report) && <TaskHeaderActionButton report={props.report} />}

  1. We should get all actions of parent report through another withOnyx and then get the parent report action inside the report screen and then we will update the the memo function to only re-render when the current parent report action is changed.

parentReportAction: {

What alternative solutions did you explore? (Optional)

NA

@lschurr
Copy link
Contributor

lschurr commented Mar 5, 2024

@melvin-bot melvin-bot bot added the Overdue label Mar 7, 2024
@lschurr lschurr added the External Added to denote the issue can be worked on by a contributor label Mar 7, 2024
@melvin-bot melvin-bot bot changed the title Task - Mark as complete button shows up on cancelled task report [$500] Task - Mark as complete button shows up on cancelled task report Mar 7, 2024
Copy link

melvin-bot bot commented Mar 7, 2024

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

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

melvin-bot bot commented Mar 7, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Mar 7, 2024
@lschurr
Copy link
Contributor

lschurr commented Mar 7, 2024

Added to #vip-vsb. @situchan can you review the proposal here when you get a chance?

@Pranav2612000
Copy link

Pranav2612000 commented Mar 9, 2024

Proposal

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

After creating a new task and then deleting it, the mark as complete button should also not be shown on the page.
For instance, in the below image, the "Mark as complete" button should not be visible because the task has been deleted.
image

An error being displayed when the button is clicked is a side-effect of this problem, and ensuring that the button is not visible should also fix this.

What is the root cause of that problem?

The ReportUtils.isOpenTaskReport function call in HeaderView.js is not being passed the parentReportAction.

{isTaskReport && !isSmallScreenWidth && ReportUtils.isOpenTaskReport(props.report) && <TaskHeaderActionButton report={props.report} />}

This is necessary because the isOpenTaskReport function calls isCanceledTaskReport which required a parentReportAction value to determine if a task is deleted or not.

isTaskReport(report) && !isCanceledTaskReport(report, parentReportAction) && report?.stateNum === CONST.REPORT.STATE_NUM.OPEN && report?.statusNum === CONST.REPORT.STATUS_NUM.OPEN

function isCanceledTaskReport(report: OnyxEntry<Report> | EmptyObject = {}, parentReportAction: OnyxEntry<ReportAction> | EmptyObject = {}): boolean {

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

  1. Pass the parentReportAction to the ReportUtils.isOpenTaskReport function call in HeaderView.js. The parentReportAction has already been defined in the component and is being used in multiple places.

    {isTaskReport && !isSmallScreenWidth && ReportUtils.isOpenTaskReport(props.report) && <TaskHeaderActionButton report={props.report} />}

  2. The above step should fix this issue, but we are using the ReportActionsUtils.getParentReportAction function to define the parentReportAction but this method has been deprecated.

    const parentReportAction = ReportActionsUtils.getParentReportAction(props.report);

    If the reviewer feels this should also be addressed in the scope of this PR. We can pass the parentReportAction as a prop to the HeaderView component. Alternatively, we can also create a new method which uses Onyx.connect() or withOnyx().

  3. If the reviewer feels its required, adding tests which test for this bug to ensure that it never creeps back in.

What alternative solutions did you explore? (Optional)

NA

Copy link

melvin-bot bot commented Mar 9, 2024

📣 @Pranav2612000! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@Pranav2612000
Copy link

Contributor details
Your Expensify account email: pranav26joglekar+expensify@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0153fc53185acededc

Copy link

melvin-bot bot commented Mar 9, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@melvin-bot melvin-bot bot added the Overdue label Mar 11, 2024
@lschurr
Copy link
Contributor

lschurr commented Mar 11, 2024

@situchan could you review?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Mar 11, 2024
@lschurr
Copy link
Contributor

lschurr commented Mar 13, 2024

Bump @situchan

@melvin-bot melvin-bot bot removed the Overdue label Mar 13, 2024
@situchan
Copy link
Contributor

There's viable proposal. I will test shortly and approve.

@dukenv0307
Copy link
Contributor

@situchan The problem is we are getting parentReportAction in the same withOnyx with report data. so parentReportAction will be undefined briefly until report data is loaded.

parentReportAction: {

Updated proposal to include the fix for this case

Copy link

melvin-bot bot commented Mar 21, 2024

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

@situchan
Copy link
Contributor

@dukenv0307's proposal looks good to me.
🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Mar 22, 2024

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

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

melvin-bot bot commented Mar 25, 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 Mar 25, 2024

📣 @dukenv0307 🎉 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 removed the Overdue label Mar 25, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 26, 2024
@dukenv0307
Copy link
Contributor

@situchan The PR is ready for review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 8, 2024
@melvin-bot melvin-bot bot changed the title [$500] Task - Mark as complete button shows up on cancelled task report [HOLD for payment 2024-04-15] [$500] Task - Mark as complete button shows up on cancelled task report Apr 8, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

Copy link

melvin-bot bot commented Apr 8, 2024

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

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

Copy link

melvin-bot bot commented Apr 8, 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.
  • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@lschurr
Copy link
Contributor

lschurr commented Apr 12, 2024

@dukenv0307 - Do we need a regression test for this one?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 14, 2024
@lschurr
Copy link
Contributor

lschurr commented Apr 15, 2024

Payment summary:

@lschurr lschurr closed this as completed Apr 15, 2024
@github-project-automation github-project-automation bot moved this from LOW to CRITICAL in [#whatsnext] #vip-vsb Apr 15, 2024
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
Status: CRITICAL
Development

No branches or pull requests

6 participants