Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.78k forks source link

mWeb - Chat - The welcome group message doesn't update when a user is removed #49933

Open lanitochka17 opened 3 hours ago

lanitochka17 commented 3 hours ago

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.41 Reproducible in staging?: Y Reproducible in production?: 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

Issue found when executing PR https://github.com/Expensify/App/pull/49618

Action Performed:

  1. FAB > start chat
  2. Select a few members and create a group chat
  3. Press on members and remove one user from the group
  4. Navigate to the group chat

Expected Result:

The removed user is not displayed in the welcome group message

Actual Result:

The removed user is still displayed in the welcome group message

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/29d62e4a-022e-4c08-b543-f4eefb949305

Message_not_updated

View all open jobs on GitHub

melvin-bot[bot] commented 3 hours ago

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.

bernhardoj commented 2 hours ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

The group welcome text doesn't immediately update its members/participant.

What is the root cause of that problem?

When we remove participant from the group, we don't immediately remove it from participants, but rather put it in pendingChatMembers list. After the request is success, the member will be removed.

Currently, we show the list of the participants from the participants without filtering the pending delete members. https://github.com/Expensify/App/blob/e84dab77b7bf3481961d590e1f547b8f7ff1b944/src/components/ReportWelcomeText.tsx#L43 https://github.com/Expensify/App/blob/e84dab77b7bf3481961d590e1f547b8f7ff1b944/src/libs/ReportUtils.ts#L2110-L2112

So, the text will still shows the pending delete member for a while.

What changes do you think we should make in order to solve the problem?

To not show the deleted member, we need to pass shouldExcludeDeleted as true.

const participantAccountIDs = ReportUtils.getParticipantsAccountIDsForDisplay(report, undefined, true);

I think we can make the default to true, but not sure why we made it false.