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-08-17] [$1000] Replies count doesn't update on a task shared in group. #23920
Go to the group and update the task using checkbox (replies count updates)
Go to assignee report and update the task using checkbox (replies count doesn't updates)
Expected Result:
The replies count should update in both the group and assignee report.
Actual Result:
The replies count updates in the group but not in assignee report.
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.47-2 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
Please re-state the problem that we are trying to solve in this issue.
Replies count doesn't update on a task shared in group.
What is the root cause of that problem?
When we complete or reopen task, we are calling completeTask and reopenTask of Task.js
In these function, we are increasing childVisibleActionCount of action.
In the reopen case:
To update childVisibleActionCount of action, we got parentReportAction from task.
This is only action of shared channel.
so only shared channel reply is increased and direct channel reply is not increased(only updated after refresh)
What changes do you think we should make in order to solve the problem?
We need to childVisibleActionCount of 2 actions(shared channels action and direct channel action).
In my test case, actions ids are 6032435466773608246 and 6281777622256522668.
We can send this as parameter to update.
What alternative solutions did you explore? (Optional)
changed the title [-]Replies count doesn't update on a task shared in group.[/-][+][$1000] Replies count doesn't update on a task shared in group.[/+]on Aug 1, 2023
constoptimisticAddCommentReport=ReportUtils.buildOptimisticTaskCommentReportAction(taskReportID,title,assignee,assigneeAccountID,`Created a task: ${title}`,parentReportID);
When we update(reopen or complete) a task using the checkbox, reopenTask/completeTask function in Task.js are called.
Let's take a look at the completeTask function here
After we set optimistic data for the task report and actions, we create the optimistic data for parent report action
If we update the task in shareDestination report, all works fine because parentReportAction is updated as well here.
But this is not the case when we update the task in assignee report. The current action of the assignee report isn't updated.
This is the root cause
What changes do you think we should make in order to solve the problem?
We should update the assignee parent action when we update the task in assignee report. It would be better if we can update two parent actions(one in shareDestination and one in assignee, of course, when they are different)
Solution 1
Pass the additional parameters to the reopenTask/completeTask functions: reportID, reportActionID in TaskPreview
Activity
melvin-bot commentedon Jul 31, 2023
Triggered auto assignment to @JmillsExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 31, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)yh-0218 commentedon Aug 1, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Replies count doesn't update on a task shared in group.
What is the root cause of that problem?
When we complete or reopen task, we are calling
completeTaskandreopenTaskofTask.jsIn these function, we are increasing
childVisibleActionCountofaction.In the reopen case:
App/src/libs/actions/Task.js
Line 339 in 3324ea7
App/src/libs/ReportUtils.js
Lines 1528 to 1543 in 3324ea7
To update
childVisibleActionCountofaction, we got parentReportAction from task.This is only action of shared channel.
so only shared channel reply is increased and direct channel reply is not increased(only updated after refresh)
What changes do you think we should make in order to solve the problem?
We need to
childVisibleActionCountof 2 actions(shared channels action and direct channel action).In my test case, actions ids are
6032435466773608246and6281777622256522668.We can send this as parameter to update.
What alternative solutions did you explore? (Optional)
We can get origin 2 actions on update function.
JmillsExpensify commentedon Aug 1, 2023
Hmmm, I agree that minimally we should be treating the history reportAction the same for the room and DM cases. I'll triage.
[-]Replies count doesn't update on a task shared in group.[/-][+][$1000] Replies count doesn't update on a task shared in group.[/+]melvin-bot commentedon Aug 1, 2023
Job added to Upwork: https://www.upwork.com/jobs/~013bbb12e93147362e
melvin-bot commentedon Aug 1, 2023
Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Aug 1, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)dummy-1111 commentedon Aug 1, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Replies count doesn't update on a task shared in group when we update the task in assignee report
What is the root cause of that problem?
When we create a task, we set the
parentReportIDof the newly created task report to theshareDestinationreportIDApp/src/pages/tasks/NewTaskPage.js
Line 99 in cb8aac1
And we create the new comment in
shareDestinationreport and set theparentReportActionIDof the task to the reportActionID of the new commentApp/src/libs/actions/Task.js
Lines 69 to 70 in cb8aac1
When we update(reopen or complete) a task using the checkbox,
reopenTask/completeTaskfunction inTask.jsare called.Let's take a look at the completeTask function here
After we set optimistic data for the task report and actions, we create the optimistic data for parent report action
App/src/libs/actions/Task.js
Line 263 in cb8aac1
If we update the task in
shareDestinationreport, all works fine because parentReportAction is updated as well here.But this is not the case when we update the task in
assigneereport. The current action of theassigneereport isn't updated.This is the root cause
What changes do you think we should make in order to solve the problem?
We should update the assignee parent action when we update the task in
assigneereport. It would be better if we can update two parent actions(one inshareDestinationand one inassignee, of course, when they are different)Solution 1
reopenTask/completeTaskfunctions:reportID,reportActionIDinTaskPreviewIf the current action is
assigneetask action,Add reportID props to the
TaskPreviewcomponent in ReportActionItemApp/src/pages/home/report/ReportActionItem.js
Line 287 in cb8aac1
reportIDandreportActionIDIf
reportIDorreportActionIDareundefined, do nothingIf not, create the optimistic data same as
optimisticParentReportDatacreated here exceptreportIDandreportActionIDSolution 2
We can always create the optmistic data for two parent report actions(in
assigneeandshareDestinationreport) as followsThe backend returns this data. This is for offline mode
Pass taskReport instead of taskReportID to
reopenTask/completeTaskin TaskPreview and TaskViewAdd the utility function
getParentReportActionForTaskin REportActionsUtils.jsThis is the function to find the reportAction with childReportID = taskReportID in reportActions of report(reportID)
reopenTask/completeTaskfunction as followstaskReportIDtotaskReportand add the first lineassigneereport.Now that we get reportID and reportActionID, we can create optmisticData from them as solution 1.
The entire code would look like
These solutions works well. I prefer the 2nd solution
Result
23920.mp4
What alternative solutions did you explore? (Optional)
We can consider the multiple parentReportID and parentReportActionID. In this case, I think the backend should be updated as well
39 remaining items
Krishna2323 commentedon Sep 5, 2023
@JmillsExpensify, can you pls provide update for payments here. Thanks
techievivek commentedon Sep 11, 2023
Not overdue, I have just DMed Jason to finish the payment here. Sorry for the delay.
JmillsExpensify commentedon Sep 13, 2023
Sorry ya'll, I'm not coming back to this issue for payments/summary.
JmillsExpensify commentedon Sep 13, 2023
Payment summary:
@Krishna2323 I believe you applied to the Upwork but for the wrong amount. @s-alves10 and @s77rt offers just sent.
Krishna2323 commentedon Sep 13, 2023
@JmillsExpensify ohh sorry, how can I apply now?
I updated the job terms.
JmillsExpensify commentedon Sep 13, 2023
Just hired you.
Krishna2323 commentedon Sep 13, 2023
@JmillsExpensify, accepted.
JmillsExpensify commentedon Sep 13, 2023
Paid
Krishna2323 commentedon Sep 13, 2023
Thanks ✌🏻
dummy-1111 commentedon Sep 13, 2023
@JmillsExpensify
Accepted
s77rt commentedon Sep 13, 2023
@JmillsExpensify Accepted! Thanks!
JmillsExpensify commentedon Sep 15, 2023
Everyone should be paid out at this point! Closing.