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

[$1000] can’t check off a task when it is “done” #19298

Closed
1 of 6 tasks
kavimuru opened this issue May 19, 2023 · 33 comments
Closed
1 of 6 tasks

[$1000] can’t check off a task when it is “done” #19298

kavimuru opened this issue May 19, 2023 · 33 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review

Comments

@kavimuru
Copy link

kavimuru commented May 19, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Assign a task to user A
  2. Log in as user B and "Mark as done" for the assigned task
  3. Login as user A and check off the task

Expected Result:

Able to check off

Actual Result:

Not able to check off

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.16.5
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
Notes/Photos/Videos: Any additional supporting documentation

Recording.657.mp4

Expensify/Expensify Issue URL:
Issue reported by: @joaniew
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684311858049629

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014b784d341e4d6cdf
  • Upwork Job ID: 1660594272412274688
  • Last Price Increase: 2023-05-22
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

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

@melvin-bot
Copy link

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

@melvin-bot melvin-bot bot added the Overdue label May 22, 2023
@bfitzexpensify
Copy link
Contributor

Reproduced

@melvin-bot melvin-bot bot removed the Overdue label May 22, 2023
@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label May 22, 2023
@melvin-bot melvin-bot bot changed the title can’t check off a task when it is “done” [$1000] can’t check off a task when it is “done” May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

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

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

melvin-bot bot commented May 22, 2023

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

@hoangzinh
Copy link
Contributor

hoangzinh commented May 22, 2023

Proposal

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

can’t check off a task when it is “done”

What is the root cause of that problem?

I think there is a redundant check whether task is completed or not in report actions view:

const isTaskCompleted =
(props.taskReport.stateNum === CONST.REPORT.STATE_NUM.SUBMITTED && props.taskReport.statusNum === CONST.REPORT.STATUS.APPROVED) ||
(props.action.childStateNum === CONST.REPORT.STATE_NUM.SUBMITTED && props.action.childStatusNum === CONST.REPORT.STATUS.APPROVED);

In TaskHeader of taskReport, we only check status of report itself

const isCompleted = props.report.stateNum === CONST.REPORT.STATE_NUM.SUBMITTED && props.report.statusNum === CONST.REPORT.STATUS.APPROVED;

=> It leads to show incorrect status of a task in reportActionsView

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

We need to remove redundant check on props.action to keep it consistency with TaskHeader of taskReport.

So the correct condition here should be:

const isTaskCompleted =
        (props.taskReport.stateNum === CONST.REPORT.STATE_NUM.SUBMITTED && props.taskReport.statusNum === CONST.REPORT.STATUS.APPROVED);

There are some valid reasons to do it:

  • When we build optimistic data for ReopenTask/CompleteTask, we only update status of taskReport
  • The success API also only return the status of taskReport
    Screenshot 2023-05-22 at 18 17 20

So the status of taskReportAction is outdated.

@kushu7
Copy link
Contributor

kushu7 commented May 22, 2023

Its a BE issue. when we reopen task
action ${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID} throwing error. thats why action is not getting updated.
Screenshot 2023-05-22 at 5 32 03 PM

@jjcoffee
Copy link
Contributor

jjcoffee commented May 22, 2023

This is a BE issue as there is no pusher event to update the task for user A's chat so it's not synchronised with the task's real state (that's why the checkbox doesn't get checked on user A's side even though the task was marked as complete by user B). You'll only get the updated task status if you open the task report.

@Santhosh-Sellavel
Copy link
Collaborator

I'm unassigning due to limited availability. Can you a assign new C+ here by re-applying the external label here, thanks!

Also @robertjchen Not sure but seems like a backend issue from a couple of comments above. Please check that before moving forward

cc: @bfitzexpensify

@Santhosh-Sellavel Santhosh-Sellavel removed their assignment May 22, 2023
@bfitzexpensify
Copy link
Contributor

@robertjchen before I assign a new C+, do you want to take a look at #19298 (comment) and confirm if this is a back-end or front-end issue?

@Santhosh-Sellavel
Copy link
Collaborator

@bfitzexpensify I'm happy take this back if C+ Needed. I'm available now.

@robertjchen
Copy link
Contributor

Yes, it looks like it's on the backend- taking this internal to work on further 🤔

@robertjchen robertjchen added Internal Requires API changes or must be handled by Expensify staff and removed 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 labels May 24, 2023
@melvin-bot melvin-bot bot added the Overdue label May 26, 2023
@bfitzexpensify
Copy link
Contributor

@aimane-chnaif @robertjchen thoughts on @hoangzinh's comment?

@melvin-bot melvin-bot bot removed the Overdue label May 29, 2023
@bfitzexpensify
Copy link
Contributor

bump @aimane-chnaif @robertjchen

@robertjchen
Copy link
Contributor

I think the core issue around inconsistent state should be resolved rather than the FE workaround. The backend should do as described here #19298 (comment) 🤔

@bfitzexpensify
Copy link
Contributor

Cool, I agree with the general idea of solving the core issue rather than using a workaround. Let's keep this internal

@melvin-bot
Copy link

melvin-bot bot commented Jun 2, 2023

@robertjchen @bfitzexpensify @aimane-chnaif this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jun 5, 2023
@bfitzexpensify
Copy link
Contributor

This one's internal, Melv

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2023
@robertjchen
Copy link
Contributor

I think I found the source of the issue on the backend. Draft PR linked and testing out the fix 👍

@robertjchen
Copy link
Contributor

Ran into some problems testing locally, going to revisit tomorrow to see if I can get it to work, hopefully will have the PR ready by EOW.

@melvin-bot melvin-bot bot added the Overdue label Jun 8, 2023
@robertjchen
Copy link
Contributor

Still testing things out locally

@melvin-bot melvin-bot bot removed the Overdue label Jun 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 9, 2023

@robertjchen @bfitzexpensify @aimane-chnaif this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

@robertjchen, @bfitzexpensify, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@robertjchen
Copy link
Contributor

Top priority today 👀

@melvin-bot melvin-bot bot removed the Overdue label Jun 13, 2023
@robertjchen
Copy link
Contributor

Fix confirmed, working on finalizing the PR/screenshots, etc. 👍

@robertjchen robertjchen added the Reviewing Has a PR in review label Jun 14, 2023
@robertjchen
Copy link
Contributor

The fix is currently on staging

@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

@robertjchen, @bfitzexpensify, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@bfitzexpensify
Copy link
Contributor

@robertjchen looks like this is on prod now (https://github.com/Expensify/Web-Expensify/pull/37714#issuecomment-1601887889) - we good to close this out?

@robertjchen
Copy link
Contributor

Yep, we're all set here!

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 Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

8 participants