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 2024-07-24] Thread - LHN displays "removed 1 user" instead of "left the chat" after leaving thread #44610
Because the action is not an invited action, the removed message is being used.
What changes do you think we should make in order to solve the problem?
We can make sure the room change log condition is only true if it's not a thread. ReportActionsUtils.isRoomChangeLogAction(lastAction) && !result.isThread.
This way, the last message of the thread report will be used, that is, left the chat.
What alternative solutions did you explore? (Optional)
We can improve the room change log message by adding the case for the leave room that returns left the chat (and it's translation). Currently, it only handles invite, remove, and update description.
Please re-state the problem that we are trying to solve in this issue.
Thread in LHN displays "removed 1 user" after leaving thread.
What is the root cause of that problem?
In the past, we moved to this case if the report action is invite or removed action. See the diff here for more details.
Now, we use isRoomChangeLogAction function that checks whether the action is a room change log action or not and it's not correct with the previous check. And then when we leave the room, the last action is LEAVEROOM action, and removed 1 user appears.
What changes do you think we should make in order to solve the problem?
We should create a new function like isInviteOrRemovedAction that will return true if the report action is one of four action types that we used in the past here.
function isInviteOrRemovedAction(reportAction: OnyxInputOrEntry<ReportAction>): reportAction is ReportAction<ValueOf<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG | typeof CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG>> {
return isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM, CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.REMOVE_FROM_ROOM, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.INVITE_TO_ROOM, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.REMOVE_FROM_ROOM);
}
And then use this function here to update the condition correctly
What alternative solutions did you explore? (Optional)
changed the title [-]Thread - LHN displays "removed 1 user" instead of "left the chat" after leaving thread[/-][+][HOLD for payment 2024-07-24] Thread - LHN displays "removed 1 user" instead of "left the chat" after leaving thread[/+]on Jul 17, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@eh2077] The PR that introduced the bug has been identified. Link to the PR:
[@eh2077] 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:
[@eh2077] A discussion in #expensify-bugs 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:
[@eh2077] Determine if we should create a regression test for this bug.
[@eh2077] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
[@eh2077] A discussion in #expensify-bugs 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
[@eh2077] Determine if we should create a regression test for this bug. NO
Activity
melvin-bot commentedon Jun 28, 2024
Triggered auto assignment to @sonialiap (
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.izarutskaya commentedon Jun 28, 2024
We think this issue might be related to the #vip-vsb
bernhardoj commentedon Jun 29, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The LHN shows removed 1 user instead of left the chat when leaving a thread.
What is the root cause of that problem?
Leaving a thread will add a LEAVEROOM action from the BE response.

And that's considered as a room change log action.
App/src/libs/SidebarUtils.ts
Lines 351 to 375 in 4622e19
Because the action is not an invited action, the removed message is being used.
What changes do you think we should make in order to solve the problem?
We can make sure the room change log condition is only true if it's not a thread.
ReportActionsUtils.isRoomChangeLogAction(lastAction) && !result.isThread.This way, the last message of the thread report will be used, that is,
left the chat.What alternative solutions did you explore? (Optional)
We can improve the room change log message by adding the case for the leave room that returns
left the chat(and it's translation). Currently, it only handles invite, remove, and update description.dominictb commentedon Jul 1, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Thread in LHN displays "removed 1 user" after leaving thread.
What is the root cause of that problem?
In the past, we moved to this case if the report action is invite or removed action. See the diff here for more details.
Now, we use
isRoomChangeLogActionfunction that checks whether the action is a room change log action or not and it's not correct with the previous check. And then when we leave the room, the last action isLEAVEROOMaction, andremoved 1 userappears.What changes do you think we should make in order to solve the problem?
We should create a new function like
isInviteOrRemovedActionthat will return true if the report action is one of four action types that we used in the past here.And then use this function here to update the condition correctly
What alternative solutions did you explore? (Optional)
melvin-bot commentedon Jul 1, 2024
@sonialiap Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Jul 2, 2024
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Jul 2, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (
External)21 remaining items
[-]Thread - LHN displays "removed 1 user" instead of "left the chat" after leaving thread[/-][+][HOLD for payment 2024-07-24] Thread - LHN displays "removed 1 user" instead of "left the chat" after leaving thread[/+]melvin-bot commentedon Jul 17, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 17, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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 2024-07-24. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 17, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
sonialiap commentedon Jul 24, 2024
Payment summary:
https://www.upwork.com/ab/applicants/1816054414293401460/job-details
melvin-bot commentedon Jul 24, 2024
Payment Summary
Upwork Job
BugZero Checklist (@sonialiap)
melvin-bot commentedon Jul 29, 2024
@arosiclair, @sonialiap, @eh2077, @dominictb Huh... This is 4 days overdue. Who can take care of this?
eh2077 commentedon Jul 30, 2024
Checklist