Open IuliiaHerets opened 2 months ago
Triggered auto assignment to @zanyrenney (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
We think that this bug might be related to #vip-vsb
@zanyrenney z 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
Edited by proposal-police: This proposal was edited at 2024-08-20 02:20:04 UTC.
LHN Message is not updated on dm of the user and the user the task assgineed to when the task title is edited
In the LHN, if the last action is a task action, the displayed last message is retrieved from the task's report.reportName
. However, the useMemo
hook for the optionItem
in LHNOption
does not currently depend on the task report data:
As a result, the displayed last message in the LHN does not update when the task report is updated.
We need to adjust the optionItem
dependency to include the lastActionChildReport
.
To address this issue:
Add a Utility Function: Add a utility function in OptionListUtils
:
function getChildReportIDofLastAction(report: OnyxEntry<Report>): string | undefined {
if (!report?.reportID) {
return;
}
const lastAction = lastVisibleReportActions[report.reportID];
return lastAction?.childReportID;
}
Update LHNOptionList
: In LHNOptionList
, add the following lines after:
const lastActionChildReportID = OptionsListUtils.getChildReportIDofLastAction(itemFullReport);
const lastActionChildReport = lastActionChildReportID ? reports?.[`${ONYXKEYS.COLLECTION.REPORT}${lastActionChildReportID}`] : undefined;
Modify OptionRowLHNData
: In OptionRowLHNData
, add the lastActionChildReport
property. Then, update the useMemo
of optionItem
to include lastActionChildReport
as a dependency:
These changes will ensure that the displayed last message in the LHN updates correctly when the task report is updated. But if we only want the reportName data we can only use the lastActionChildReport.reportName as dependency to be more efficient.
nice! looking at external label noq
Job added to Upwork: https://www.upwork.com/jobs/~01df2aca4c9f6dbfa6
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External
)
Edited subtask name not updated in 1:1 chat with user B in LHN
When we get the lastMessageTextFromReport
we've had the logic to get the task created message via task report
But the problem here is that lastMessageTextFromReport
is calculated in SidebarUtils
, and we call it here. The OptionRowLHNData
of the DM report doesn't re-render when the task report is changed, which causes this bug.
After the EditTask
API is called, only the parent report action of task report is updated then we will not see this bug for shared report.
The getLastMessageTextForReport
function has some cases in which we will get the data from other reports. It's better if we get this in LHNOptionsList
here because we've had dependency for all reports. Follow the pattern we do it here
visibleReportActionItems[report.reportID]
is lastReportAction
here because we've sorted the display report action
report
is itemFullReport
policy
is itemPolicy
let lastActorDetails: Partial<PersonalDetails> | null = itemFullReport?.lastActorAccountID && personalDetails?.[itemFullReport.lastActorAccountID] ? personalDetails[itemFullReport.lastActorAccountID] : null;
if (!lastActorDetails && lastReportAction) {
const lastActorDisplayName = lastReportAction?.person?.[0]?.text;
lastActorDetails = lastActorDisplayName
? {
displayName: lastActorDisplayName,
accountID: report.lastActorAccountID,
}
: null;
}
const lastMessageTextFromReport = OptionsListUtils.getLastMessageTextForReport(itemFullReport, lastActorDetails, itemPolicy);
Then we can pass lastMessageTextFromReport
from LHNOptionsList
--> OptionRowLHNData
--> SidebarUtils
and we can remove the logic calculate lastMessageTextFromReport
in SidebarUtils
since we've passed a param to this function or we can still keep this logic and do this if lastMessageTextFromReport
param is undefined
.
NA
~taking over this issue (slack context here), @zanyrenney can you please assign me here 😸~
Edit, @allroundexperts , is taking this one over (slack)
Thanks for the proposals everyone.
Since the backend updates the report action of the dm task, I think we should do the same in the optimistic response as well. As such, @tsa321's proposal looks good to me.
🎀 👀 🎀 C+ reviewed
Triggered auto assignment to @cead22, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@allroundexperts I don't think it's a good idea because
TaskPreview
. The current problem here is OptionRowLHN
isn't re-rendered when the task report is changed. If we offline and go to the DM after editing the task title, the TaskPreview
doesn't have this bug because this component is re-rendered when the task report is changed. Of If we force offline and refresh the page after editing the task title, LHN of DM chat will be updated.updated @allroundexperts I have updated my proposal to address the issue of LHN data, which needs to depend on the related task report.
Adding the task report as a dependency can cause many unnecessary re-renders for OptionRownLHNData
of all parent reports that are related to the task report which is a bad performance for OptionRownLHNData
I'm the first one who has the correct RCA and the solution which is to re-render OptionRownLHNData
and re-calculate SidebarUtils.getOptionData
@mkzie2 I think I had different results when testing this offline. When I was offline, no matter how many times I refreshed, the LHN did not update with the correct data. Can you post a video of the data updating after refreshing when offline?
@allroundexperts The video here.
https://github.com/user-attachments/assets/a5958f36-63cb-49b2-95eb-7334ad8cc616
@allroundexperts The video here.
Untitled.mp4
Hm... I see now. I was 'refreshing' the page. Instead, I just moved across the screens.
Given above, I'd agree that @mkzie2's proposal is more accurate. Let's go with them instead.
🎀 👀 🎀 C+ reviewed
Current assignee @cead22 is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
📣 @mkzie2 You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖
@zanyrenney / @cead22 For this issue, could you please unassign me from C+ and assign the @allroundexperts instead?
This issue has not been updated in over 15 days. @cead22, @allroundexperts, @zanyrenney, @mkzie2 eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
@zanyrenney The PR was deployed to production. Please help to process the payment here.
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: 9.0.22-1 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+jp_e_category_2@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Edited subtask name updated in 1:1 chat with user B in LHN
Actual Result:
Edited subtask name not updated in 1:1 chat with user B in LHN
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/db4d3761-a989-4f55-a102-7ca20697f02c
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jayeshmangwani