-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Edited thread message does not update in LHN. #23897
Comments
Triggered auto assignment to @johncschuster ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Editing the first message of a thread doesn't change the title in LHN What is the root cause of that problem?The LHN contents is updated when the report is updated as you can see here App/src/components/LHNOptionsList/OptionRowLHNData.js Lines 73 to 81 in eb02006
But when edit the first thread message, only the parent report is changed and the thread report is not changed. Please refer App/src/libs/actions/Report.js Lines 1095 to 1099 in eb02006
In the above code, the originalReportID is parent report ID for the first thread message. As you can see, the thread report isn't being updated. This is the root cause. What changes do you think we should make in order to solve the problem?We need to change the thread report when the first thread message is updated
This works great Result23897.mp4What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Editing the first message of a thread doesn't change the title in LHN What is the root cause of that problem?That issue is not present in the latest code of the project (I have checked from the MAIN branch), The last message edit is being reflected in the side bar section. There is another issue similar to this, If you try to edit any other message not the last message, Changes does not reflected to the sidebar section. Here is the attached video, Where last message edit is working fine but any other message edit is not being updated in the side section. LastMessageHasEffect1.movThe Root cause of this issue is App/src/libs/actions/Report.js Lines 1089 to 1100 in 62622e9
Here, If the reportActionID matches the lastVisibleAction.reportID, then it show the effect. and for a report the lastvisibleAction is adding a comment, which will be the last comment added. What changes do you think we should make in order to solve the problem?The solution to this problem is to update the message itself which is being edited when it's not the last message of any report. We will replace the above if section with the following code. if (reportActionID === lastVisibleAction.reportActionID) {
const lastMessageText = ReportUtils.formatReportLastMessageText(reportComment);
const optimisticReport = {
lastMessageTranslationKey: '',
lastMessageText,
};
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${originalReportID}`,
value: optimisticReport,
});
} {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
lastReadTime: DateUtils.getDBTime(),
},
});
} After the above solution, every message editing will have the effect in the side bar as shown in the video. EveryMessageEffect.movWhat alternative solutions did you explore? (Optional)N/A |
📣 @pravinkumar57! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Dupe here: #23424 |
Thanks for flagging that, @dukenv0307! Let's close this issue in favor of #23424 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
LHN thread title should show the edited message.
Actual Result:
LHN shows the old message.
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?
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
thread-hedaer-message.mov
Recording.1406.mp4
Expensify/Expensify Issue URL:
Issue reported by: @jayeshmangwani
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690627045335319
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: