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 2025-01-15] [$250] Chat - For removed user system message, reply in thread page header doesn't shown mentions #54621
Version Number: 9.0.79-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team Component: Chat Report View
Attachments
Drag a file
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can add a test for getReportName to assert it returns the correct report name for chat threads with this type of parent report action
What alternative solutions did you explore? (Optional)
If needed we can also make the LHN text consistent but it looks like we are intentionally displaying removed 1 user kind of text by handling them specifically here
But this function always returns early because we're using the || condition here. This condition is always true because if an action is isPolicyChangeLogAction, it will not be isRoomChangeLogAction and vice versa.
getAdminRoomInvitedParticipants always returns parentReportActionMessage and we get it in parseReportActionHtmlToText with mentioned regex here that doesn't cover the mention like <muted-text>removed <mention-user accountID=...></mention-user></muted-text> (this the the regex of invite/remove room member system message).
What changes do you think we should make in order to solve the problem?
We should update this condition correctly by using && instead of ||. For the bug of parseReportActionHtmlToText function, I think it should be handled in a separate issue since it's not the RCA of this issue.
if (!ReportActionsUtils.isPolicyChangeLogAction(parentReportAction) ?? !ReportActionsUtils.isRoomChangeLogAction(parentReportAction)) {
return parentReportActionMessage || Localize.translateLocal('parentReportAction.deletedMessage');
}
That is inconsistent we also need to fix it by using the same function getEffectiveDisplayName or getDisplayNameForParticipant.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We need to add a test case for getAdminRoomInvitedParticipants function and verify that it returns the correct message for isPolicyChangeLogAction, isRoomChangeLogAction and other actions
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Chat - For removed user system message, reply in thread page header doesn't shown mentions[/-][+][$250] Chat - For removed user system message, reply in thread page header doesn't shown mentions[/+]on Dec 30, 2024
changed the title [-][$250] Chat - For removed user system message, reply in thread page header doesn't shown mentions[/-][+][HOLD for payment 2025-01-15] [$250] Chat - For removed user system message, reply in thread page header doesn't shown mentions[/+]on Jan 8, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.81-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@dukenv0307@slafortune@dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Create a new room
Invite some members and then remove some members
Click on the invite/remove system message and Reply in thread
Verify that the thread header displays the same as the action in report screen
Activity
melvin-bot commentedon Dec 27, 2024
Triggered auto assignment to @slafortune (
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.FitseTLT commentedon Dec 27, 2024
Edited by proposal-police: This proposal was edited at 2024-12-27 14:10:53 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Chat - For removed user system message, reply in thread page header doesn't shown mentions
What is the root cause of that problem?
We are not specifically handling member change parent actions in getReportName just like we did for context menu action to parse the mentions
App/src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Lines 412 to 414 in 12e0941
so it is falling back to the report action message parsed without the mentions
What changes do you think we should make in order to solve the problem?
We should handle it specifically here to align how they are displayed in ReportActionItemMessage below here or above here
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can add a test for getReportName to assert it returns the correct report name for chat threads with this type of parent report action
What alternative solutions did you explore? (Optional)
If needed we can also make the LHN text consistent but it looks like we are intentionally displaying
removed 1user kind of text by handling them specifically heretruph01 commentedon Dec 30, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
When retrieving the report name to display in the header, the function parseReportActionHtmlToText is used.
Within this function, the incorrect
mentionUserRegexis applied:App/src/libs/ReportUtils.ts
Line 3913 in 12e0941
but does not match the assumed HTML format.
What changes do you think we should make in order to solve the problem?
<any-tag></any-tag>to<any-tag />and use that value instead. So in here, add:then use it in here and here instead of raw html.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
<any-tag></any-tag>and<any-tag />.What alternative solutions did you explore? (Optional)
App/src/libs/ReportUtils.ts
Line 3913 in 12e0941
to make sure to match both
<any-tag></any-tag>and<any-tag />:expensify-common.mkzie2 commentedon Dec 30, 2024
Edited by proposal-police: This proposal was edited at 2024-12-31 05:17:07 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
For removed user system message, reply in thread page header doesn't shown mentions
What is the root cause of that problem?
We've already handled the invite/remove message for parent report action of a thread message here
App/src/libs/ReportUtils.ts
Lines 4072 to 4074 in 12e0941
But this function always returns early because we're using the
||condition here. This condition is alwaystruebecause if an action isisPolicyChangeLogAction, it will not beisRoomChangeLogActionand vice versa.App/src/libs/ReportUtils.ts
Lines 3835 to 3837 in 12e0941
getAdminRoomInvitedParticipantsalways returnsparentReportActionMessageand we get it inparseReportActionHtmlToTextwith mentioned regex here that doesn't cover the mention like<muted-text>removed <mention-user accountID=...></mention-user></muted-text>(this the the regex of invite/remove room member system message).App/src/libs/ReportUtils.ts
Line 3886 in dae99d1
So the thread header only shows
removedWhat changes do you think we should make in order to solve the problem?
&&instead of||. For the bug ofparseReportActionHtmlToTextfunction, I think it should be handled in a separate issue since it's not the RCA of this issue.App/src/libs/ReportUtils.ts
Lines 3835 to 3837 in 12e0941
getEffectiveDisplayNamefunction that will prioritize theloginof the userApp/src/libs/ReportActionsUtils.ts
Line 1186 in 8921546
and for the header, we use
getDisplayNameForParticipantfunction that will prioritize the display name.App/src/libs/ReportUtils.ts
Line 3843 in 8921546
That is inconsistent we also need to fix it by using the same function
getEffectiveDisplayNameorgetDisplayNameForParticipant.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We need to add a test case for
getAdminRoomInvitedParticipantsfunction and verify that it returns the correct message forisPolicyChangeLogAction,isRoomChangeLogActionand other actionsWhat alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Chat - For removed user system message, reply in thread page header doesn't shown mentions[/-][+][$250] Chat - For removed user system message, reply in thread page header doesn't shown mentions[/+]melvin-bot commentedon Dec 30, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021873792561565329294
melvin-bot commentedon Dec 30, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (
External)15 remaining items
[-][$250] Chat - For removed user system message, reply in thread page header doesn't shown mentions[/-][+][HOLD for payment 2025-01-15] [$250] Chat - For removed user system message, reply in thread page header doesn't shown mentions[/+]melvin-bot commentedon Jan 8, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 8, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.81-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-01-15. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 8, 2025
@dukenv0307 @slafortune @dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
dukenv0307 commentedon Jan 8, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/40168/files#r1906273582
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again. Yes
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Do we agree 👍 or 👎
slafortune commentedon Jan 15, 2025
@dukenv0307 requires payment through NewDot Manual Requests - DUE $250
@mkzie2 Role Contributor - Paid $250 via Upworkds
JmillsExpensify commentedon Mar 3, 2025
$250 approved for @dukenv0307