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 2023-11-30] [$500] Task - Not here page appears briefly when closing task error message in public room #31446

Closed
5 of 6 tasks
kbecciv opened this issue Nov 16, 2023 · 21 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

@kbecciv
Copy link

kbecciv commented Nov 16, 2023

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: 1.4.0
Reproducible in staging?: y
Reproducible in production?: y
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. Log out if logged in.
  2. Navigate to a public room that has an unassigned task (https://staging.new.expensify.com/r/2376199970894587
    ).
  3. Tap on the unassigned task.
  4. Tap Mark as complete.
  5. Close the error message.

Expected Result:

Error message will be dismissed without any error message.

Actual Result:

Not here page shows up briefly after closing the error message

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

Bug6279168_1700143737096.RPReplay_Final1700135526.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010013646d8714a6e0
  • Upwork Job ID: 1725155572948697088
  • Last Price Increase: 2023-11-16
  • Automatic offers:
    • dukenv0307 | Contributor | 27722578
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 16, 2023
@melvin-bot melvin-bot bot changed the title Task - Not here page appears briefly when closing task error message in public room [$500] Task - Not here page appears briefly when closing task error message in public room Nov 16, 2023
Copy link

melvin-bot bot commented Nov 16, 2023

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

Copy link

melvin-bot bot commented Nov 16, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 16, 2023
Copy link

melvin-bot bot commented Nov 16, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Nov 16, 2023

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

@DylanDylann
Copy link
Contributor

DylanDylann commented Nov 16, 2023

Proposal

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

  • Task - Not here page appears briefly when closing task error message in public room

What is the root cause of that problem?

  • When closing the error, we will delete the report
    const taskReportID = reportAction.message?.[0]?.taskReportID;
    if (taskReportID) {
    Report.deleteReport(taskReportID);
    }
  • That leads to the "not found page" appear for a while.

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

  • We should only call deleteReport if the reportAction is not in the task report by updating:

const taskReportID = reportAction.message?.[0]?.taskReportID;
if (taskReportID) {
Report.deleteReport(taskReportID);
}

to:

 const taskReportID = reportAction.message?.[0]?.taskReportID;
        if (taskReportID && !ReportUtils.isTaskReport(ReportUtils.getReport(reportID))) {
            Report.deleteReport(taskReportID);
        }

What alternative solutions did you explore? (Optional)

  • NA

@aaabccczzz05
Copy link

aaabccczzz05 commented Nov 16, 2023

Proposal

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

The task show not found briefly when close the error

What is the root cause of that problem?

We always delete the task report if we close the error from the task action in the task report, its purpose here is to delete the task report created with error by delete task preview.

const taskReportID = reportAction.message?.[0]?.taskReportID;
if (taskReportID) {
Report.deleteReport(taskReportID);
}

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

We should get exactly the task report

if (reportAction.childReportID && reportActions.childType === 'task') {
    Report.deleteReport(reportAction.childReportID);
}

What alternative solutions did you explore? (Optional)

N/A

Copy link

melvin-bot bot commented Nov 16, 2023

📣 @aaabccczzz05! 📣
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>

@dummy-1111
Copy link
Contributor

Proposal

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

Not here page appears for a brief moment when closing task error in a public room

What is the root cause of that problem?

When closing a error, clearReportActionErrors is called

Let's take a look into this function

// Delete the failed task report too
const taskReportID = reportAction.message?.[0]?.taskReportID;
if (taskReportID) {
Report.deleteReport(taskReportID);
}

As you can see above, we delete task report if message.[0].taskReportID exists. This was added to delete a task report failed in creation in the PR #26848. It looks like the author assumed that message.[0].taskReportID exists only when creating a task, but this field exists in optimistic report action for completing/reopening/cancelling a task as well. Please refer the below code segment

App/src/libs/ReportUtils.js

Lines 2862 to 2868 in 1deced4

message: [
{
text: message,
taskReportID,
type: CONST.REPORT.MESSAGE.TYPE.TEXT,
},
],

That is why the task report is deleted from onyx store

This is the root cause

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

In order to solve this issue, we need to modify the condition for deleting a task report
Update

// Delete the failed task report too
const taskReportID = reportAction.message?.[0]?.taskReportID;
if (taskReportID) {
Report.deleteReport(taskReportID);
}

to

        // Delete the failed task report too
        if (ReportActionUtils.isCreatedTaskReportAction(reportAction)) {
            Report.deleteReport(reportAction.message?.[0]?.taskReportID ?? '');
        }

This works as expected

Result
31446.mp4

What alternative solutions did you explore? (Optional)

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 16, 2023

Proposal

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

Not here page appears briefly when closing task error message in public room

What is the root cause of that problem?

We don't check to not allow anonymous user complete or re-open task here. And then error is returned from BE after anonymous user does this action.

onPress={() => (ReportUtils.isCompletedTaskReport(props.report) ? Task.reopenTask(props.report) : Task.completeTask(props.report))}

When we close the error, the task report is deleted here.

// Delete the failed task report too
const taskReportID = reportAction.message?.[0]?.taskReportID;
if (taskReportID) {
Report.deleteReport(taskReportID);
}

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

  1. We should add a check here to redirect anonymous user to sign in modal to make it the same behavior when we click on the checkbox by using Session.checkIfActionIsAllowed function

onPress={() => (ReportUtils.isCompletedTaskReport(props.report) ? Task.reopenTask(props.report) : Task.completeTask(props.report))}

  1. I think BE should fix to remove taskReportID field from message of task report action.
    OPTION: We can also add the safe check here to not delete task report when we clear the error from task system action.
    // Delete the failed task report too
    const taskReportID = reportAction.message?.[0]?.taskReportID;
    if (taskReportID) {
    Report.deleteReport(taskReportID);
    }

What alternative solutions did you explore? (Optional)

@narefyev91
Copy link
Contributor

I think the main root case here - that we allow anonymous user to ability complete / re-open task interaction - which should not be - and BE correctly rejecting that try - but we should block it before on FE side (which will avoid any bugs which we see now or may see in future).
Following all other patterns from public rooms - we ask user to sign in - to make any operation which required from signed user. Based on that - i think @dukenv0307 proposal makes sense to me #31446 (comment)
🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 17, 2023

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

@dummy-1111
Copy link
Contributor

@narefyev91

I think calling completeTask may result in error due to some other reason like network status, etc. Also, unauthorized user may try to complete the task. In those cases, we need not to delete the task report itself. Obviously, deleting task report when clearing an error is a bug if that's not the task creation error. I'm sure we have to handle this case

cc @tylerkaraszewski @laurenreidexpensify

@narefyev91
Copy link
Contributor

@narefyev91

I think calling completeTask may result in error due to some other reason like network status, etc. Also, unauthorized user may try to complete the task. In those cases, we need not to delete the task report itself. Obviously, deleting task report when clearing an error is a bug if that's not the task creation error. I'm sure we have to handle this case

cc @tylerkaraszewski @laurenreidexpensify

I think when user click on Complete Task - we should show right panel with Login flow - and ask user to login to make this action, rather than allow user to try to complete.
User should not come to this code below - when user do not have permissions to do it.

 const taskReportID = reportAction.message?.[0]?.taskReportID; 
 if (taskReportID) { 
     Report.deleteReport(taskReportID); 
 } 

In any case final decision for @tylerkaraszewski

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 17, 2023
Copy link

melvin-bot bot commented Nov 17, 2023

📣 @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 added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 20, 2023
@dukenv0307
Copy link
Contributor

@narefyev91 The PR is ready for review.

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Nov 23, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Nov 23, 2023
@melvin-bot melvin-bot bot changed the title [$500] Task - Not here page appears briefly when closing task error message in public room [HOLD for payment 2023-11-30] [$500] Task - Not here page appears briefly when closing task error message in public room Nov 23, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 23, 2023
Copy link

melvin-bot bot commented Nov 23, 2023

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

Copy link

melvin-bot bot commented Nov 23, 2023

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

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Nov 23, 2023

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:

  • [@narefyev91] The PR that introduced the bug has been identified. Link to the PR:
  • [@narefyev91] 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:
  • [@narefyev91] 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:
  • [@narefyev91] Determine if we should create a regression test for this bug.
  • [@narefyev91] 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.
  • [@laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@laurenreidexpensify laurenreidexpensify added Daily KSv2 and removed Weekly KSv2 labels Nov 30, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 30, 2023
@laurenreidexpensify
Copy link
Contributor

Payment Summary:

Contributor - $500 @dukenv0307 payment issued in Upwork
C+ - @narefyev91 expert contributor no payment

@melvin-bot melvin-bot bot removed the Overdue label Nov 30, 2023
@laurenreidexpensify
Copy link
Contributor

@narefyev91 pls complete checklist and advise on regression test thanks

@narefyev91
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR - that issue was not coming from any regressions - just missing functionality
  • 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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Nov 30, 2023
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
None yet
Development

No branches or pull requests

8 participants