You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-07-21] [$1000] Message “Complete task…” should not be displayed when the user is marked as done task not assigned #20542
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.26-1 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
At all these places we are not adding any check if the button can be clicked by particular user or not.
These buttons are visible to everyone.
What changes do you think we should make in order to solve the problem?
We can add the check to confirm if the user has right access to perform certain action.
And that action can be performed or not.
With my understanding, I think the task creator and assignee can perform the action of Mark as Done or Mark As Incomplete.
For checkbox and button we can add the disable prop according to those user level permissions and add a tooltip to describe that they are not allowed to perform this action.
For menuItem we can add another condition in if statement.
As mentioned in this comment #20542 (comment)
We will need to have errors handled, this is new part to proposal -
We need to update thefailureData in Task, there are three situations that need to be handled -
When user performs -
Mark as done
Cancel
Mark as Incomplete (reopen)
We need to decide on the message that we need to show to user. To handle the failure data we'll add the error message as -
Mark as done action -
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
value: {[completedTaskReportAction.reportActionID]: {pendingAction: null,
errors: ErrorUtils.getMicroSecondOnyxError("You don't have permission to complete, re-open or cancel this task")}},
Cancel action -
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
value: {[optimisticCancelReportAction.reportActionID]: {
errors: ErrorUtils.getMicroSecondOnyxError("You don't have permission to complete, re-open or cancel this task")}
,
Reopen action -
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
value: {[reopenedTaskReportAction.reportActionID]: {
errors: ErrorUtils.getMicroSecondOnyxError("You don't have permission to complete, re-open or cancel this task")}
},
What alternative solutions did you explore? (Optional)
Please re-state the problem that we are trying to solve in this issue.
The message “completed task” and “Re open task” does not appear in task detail when ticking the checkbox or press “Mark as done”, “Mark as incomplete” on task not assinged
What is the root cause of that problem?
Now, Only the task creator and assignee can complete and repoen the task. After calling completeTask and reopenTask, reportAction is saved to Onyx with optimisticData, But after API return permission error, failureData has not deleted reportAction saved above.
@NicMendonca It seems you miss this point
July 1st and July 2nd are on the weekend and then This PR is on hold from 3/6 to 6/6 (GMT +7) (The PR should be held on this time so this period is not included in the bonus timeline)
And I added this comment #20542 (comment) to wait for internal team to add waiting for copy label to assign a member that can help us confirm the translation key. So from 3/6 to 6/6 the PR was held for this and I think it shouldn't be calculated to work day.
After the confirmation C+ approve the PR on July 6
Before the CME of this issue back from OOO, we just need to merge main to resolve the conflict.
Activity
melvin-bot commentedon Jun 9, 2023
Triggered auto assignment to @puneetlath (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 9, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)BhuvaneshPatil commentedon Jun 9, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The task that has no assignee can be marked as done by other user
What is the root cause of that problem?
There are three places from where a task can be marked as completed
A check box in TaskPreview
App/src/components/ReportActionItem/TaskPreview.js
Lines 69 to 81 in 4cad248
Mark As Done button in TaskHeader
App/src/components/TaskHeader.js
Lines 94 to 100 in 4cad248
Mark as Done option in HeaderView
App/src/pages/home/HeaderView.js
Lines 92 to 96 in 4cad248
At all these places we are not adding any check if the button can be clicked by particular user or not.
These buttons are visible to everyone.
What changes do you think we should make in order to solve the problem?
We can add the check to confirm if the user has right access to perform certain action.
And that action can be performed or not.
With my understanding, I think the task creator and assignee can perform the action of
Mark as DoneorMark As Incomplete.For checkbox and button we can add the disable prop according to those user level permissions and add a tooltip to describe that they are not allowed to perform this action.
For
menuItemwe can add another condition inifstatement.As mentioned in this comment #20542 (comment)
We will need to have errors handled, this is new part to proposal -
We need to update the
failureDatain Task, there are three situations that need to be handled -When user performs -
We need to decide on the message that we need to show to user. To handle the
failuredata we'll add the error message as -What alternative solutions did you explore? (Optional)
None
melvin-bot commentedon Jun 9, 2023
Triggered auto assignment to @NicMendonca (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 9, 2023
puneetlath commentedon Jun 9, 2023
@NicMendonca re-assigning over to you since i'm going OOO for the next week. Thanks!
namhihi237 commentedon Jun 9, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The message “completed task” and “Re open task” does not appear in task detail when ticking the checkbox or press “Mark as done”, “Mark as incomplete” on task not assinged
What is the root cause of that problem?
Now, Only the task creator and assignee can complete and repoen the task. After calling completeTask and reopenTask, reportAction is saved to Onyx with optimisticData, But after API return permission error, failureData has not deleted reportAction saved above.
App/src/libs/actions/Task.js
Lines 204 to 208 in 4cad248
App/src/libs/actions/Task.js
Lines 260 to 264 in 4cad248
What changes do you think we should make in order to solve the problem?
To solve this problem we will set reportAction = null if the API returns an error.
In completedTask:
In reopenTask:
Result:
Screen.Recording.2023-06-10.at.05.08.13.mov
What alternative solutions did you explore? (Optional)
Disable button, checkbox where these 2 APIs are called by checking if current user is owner or assigned
107 remaining items
mollfpr commentedon Jul 24, 2023
@NicMendonca Nope, still using same old Upwork.
namhihi237 commentedon Jul 24, 2023
I just accepted @NicMendonca
NicMendonca commentedon Jul 24, 2023
everyone has been paid ✅ BZ checklist done ✅
Thanks!
dukenv0307 commentedon Jul 27, 2023
@NicMendonca I think this issue is eligible for a bonus timeline. Because
cc @mollfpr
NicMendonca commentedon Jul 27, 2023
@dukenv0307 I am not reading this as within 3 business days:
dukenv0307 commentedon Jul 28, 2023
@NicMendonca
NicMendonca commentedon Jul 30, 2023
I'm sorry - I am still not reading this as the PR being merged within 3 business days.
If you were assigned on the 30th on June and requested internal eng on July 6th, then that is 5 business days
NicMendonca commentedon Jul 30, 2023
discussing internally here
dukenv0307 commentedon Jul 31, 2023
@NicMendonca It seems you miss this point
July 1st and July 2nd are on the weekend and then This PR is on hold from 3/6 to 6/6 (GMT +7) (The PR should be held on this time so this period is not included in the bonus timeline)
NicMendonca commentedon Aug 1, 2023
@dukenv0307 I am not counting the weekend.
I am counting as followed:
^ This is 4 business days.
dukenv0307 commentedon Aug 1, 2023
@NicMendonca
My timezone (GMT + 7)
I was assigned on July 1
After the weekend, I created the PR on July 3
And I added this comment #20542 (comment) to wait for internal team to add waiting for copy label to assign a member that can help us confirm the translation key. So from 3/6 to 6/6 the PR was held for this and I think it shouldn't be calculated to work day.
After the confirmation C+ approve the PR on July 6
Before the CME of this issue back from OOO, we just need to merge main to resolve the conflict.
Correct me If I missed something.
NicMendonca commentedon Aug 1, 2023
@dukenv0307 you're not missing something, but there is a lot of grey areas here.
So to that end, @mollfpr @dukenv0307 speed bonus has been paid via Upwork.