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.53k stars 2.88k forks source link

[$250] Group chat - After removing user, group name is not updated #49491

Closed IuliiaHerets closed 3 weeks ago

IuliiaHerets commented 1 month 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.38-0 Reproducible in staging?: Y Reproducible in production?: Y Issue reported by: Applause Internal Team

Action Performed:

  1. Launch app
  2. Tap fab -- start chat
  3. Select a user with a custom name eg: jaihanumanblog@gmail.com and tap add to group
  4. Open the group name and note user name shown
  5. Select the user and now note the group name updated without user name
  6. Tap back
  7. Select a user with a custom name eg: jaihanumanblog@gmail.com and tap add to group
  8. Tal start group
  9. Tap header
  10. Tap the group name and note user name shown
  11. Remove the user
  12. Tap group name and note group name not updated without user name and just a swipe down shows character limit error

Expected Result:

After removing user, group name must be updated.

Actual Result:

After removing user, group name is not updated.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/81373144-e0f7-42db-97ae-9d8ea1f29aea

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021836866126068088205
  • Upwork Job ID: 1836866126068088205
  • Last Price Increase: 2024-09-19
  • Automatic offers:
    • c3024 | Reviewer | 104061081
    • FitseTLT | Contributor | 104061083
Issue OwnerCurrent Issue Owner: @twisterdotcom
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @twisterdotcom (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.

IuliiaHerets commented 1 month ago

@twisterdotcom 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

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~021836866126068088205

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (External)

abzokhattab commented 1 month ago

what should happen if the user changed the group name to something else before removing a user?

FitseTLT commented 1 month ago

Proposal

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

Group chat - After removing user, group name is not updated

What is the root cause of that problem?

We are not removing pending delete participants when we construct a default (when there is no custom group name) group name here

https://github.com/Expensify/App/blob/98dc643e14378f654e45a7ce96f35be9f407c007/src/libs/ReportUtils.ts#L2163

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

We should filter out participants with pending delete from report.participants

    let participantAccountIDs =
        participants?.map((participant) => participant.accountID) ??
        Object.keys(report?.participants ?? {})
            .map(Number)
            .filter((accountID) => {
                const pendingMember = report?.pendingChatMembers?.find((member) => member.accountID === accountID.toString());
                return !(pendingMember && pendingMember.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
            });

What alternative solutions did you explore? (Optional)

c3024 commented 1 month ago

@FitseTLT 's proposal here LGTM!

πŸŽ€ πŸ‘€ πŸŽ€ C+ Reviewed

c3024 commented 1 month ago

πŸŽ€ πŸ‘€ πŸŽ€ C+ Reviewed

melvin-bot[bot] commented 1 month ago

Current assignee @bondydaa is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 1 month ago

πŸ“£ @c3024 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 1 month ago

πŸ“£ @FitseTLT πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

twisterdotcom commented 1 month ago

Let us know how you're getting on @FitseTLT!

melvin-bot[bot] commented 1 month ago

@bondydaa, @twisterdotcom, @FitseTLT, @c3024 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

FitseTLT commented 1 month ago

PR created

bondydaa commented 3 weeks ago

hmm automation failed looks like this was deployed 2 weeks ago https://github.com/Expensify/App/pull/49618#issuecomment-2384303283

c3024 commented 3 weeks ago

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:

  • [x] [@c3024] The PR that introduced the bug has been identified. Link to the PR: #46703
  • [x] [@c3024] 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/46703/files#r1801578029
  • [x] [@c3024] 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: No discussion was started because this could not have been identified earlier.
  • [x] [@c3024] Determine if we should create a regression test for this bug. Yes
  • [x] [@c3024] 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.

Regression Test Proposal

  1. FAB > Start chat
  2. Select a few members and create a group chat
  3. Go to the group chat report
  4. Click on the group chat header
  5. Press on "Members" in the right hand panel
  6. Select a member and remove them from the group
  7. Verify that the group chat name does not contain name/login of the removed user in Step 6
c3024 commented 3 weeks ago

@twisterdotcom

Can you please handle the payment here? Thanks!

twisterdotcom commented 3 weeks ago

Payment Summary: