Skip to content

[Due for payment 2025-10-22] [$250] Chat -User can select and complete invite already member to group chat #71156

Closed

Description

@mitarachim

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: v9.2.17-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-902/folder/13176684/41236578/912954145
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Win 11/Chrome
App Component: Chat Report View

Action Performed:

  1. Open https://staging.new.expensify.com
  2. Create a group chat
  3. Click on the header of group chat
  4. Click on Members
  5. Click Invite Member
  6. Type the already member of group
  7. Select this member
  8. Click on Invite

Expected Result:

Message inform the member already a member of group should keep on screen and user can't select this member.

Actual Result:

Message inform the member already a member of group briefly display and disappear, then user can select this member, avatar of this member is displayed as no existing account. User can invite this member to group chat and no duplicate member is added

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Image
Bug6954069_1758677490038.Recording__1314.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021971633138793887943
  • Upwork Job ID: 1971633138793887943
  • Last Price Increase: 2025-09-26
  • Automatic offers:
    • nkdengineer | Contributor | 109071038
Issue OwnerCurrent Issue Owner: @jayeshmangwani

Activity

  1. added
    Daily
    Bug
    on Sep 24, 2025
  2. melvin-bot commented on Sep 24, 2025

    @melvin-bot

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

  3. nkdengineer commented on Sep 24, 2025

    @nkdengineer
    Contributor

    Proposal

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

    Message inform the member already a member of group briefly display and disappear, then user can select this member, avatar of this member is displayed as no existing account. User can invite this member to group chat and no duplicate member is added

    What is the root cause of that problem?

    We don't pass excludeLogins config when creating the userToInvite option here then it always creates the invite option even though the login is already a member of the group chat.

    userToInvite = filterUserToInvite({currentUserOption: currentUserRef.current, recentReports: recentReportOptions, personalDetails: personalDetailsOptions}, searchString ?? '');

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

    We should pass the excludeLogins here

    userToInvite = filterUserToInvite({currentUserOption: currentUserRef.current, recentReports: recentReportOptions, personalDetails: personalDetailsOptions}, searchString ?? '', {excludeLogins: loginsToExclude});
    

    userToInvite = filterUserToInvite({currentUserOption: currentUserRef.current, recentReports: recentReportOptions, personalDetails: personalDetailsOptions}, searchString ?? '');

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    Verify that getValidOptions function doesn't return userToInvite option if the search text is the excludeLogins

    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.

  4. nyomanjyotisa commented on Sep 24, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Chat - User can select and complete invite already member to group chat

    What is the root cause of that problem?

    useSearchSelector is always invoked with includeUserToInvite: true which hides the “already a member” message and allows selection even when the searched login is already a member

    const {searchTerm, setSearchTerm, availableOptions, selectedOptions, selectedOptionsForDisplay, toggleSelection, areOptionsInitialized, onListEndReached} = useSearchSelector({
    selectionMode: CONST.SEARCH_SELECTOR.SELECTION_MODE_MULTI,
    searchContext: CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_MEMBER_INVITE,
    includeUserToInvite: true,
    excludeLogins: excludedUsers,
    includeRecentReports: true,
    shouldInitialize: didScreenTransitionEnd,
    });

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

    • Normalize the typed input like the headerMessage does
    • If the normalized login is in excludedUsers, pass includeUserToInvite: false to useSearchSelector
        // Track the raw input locally
        const [searchValue, setSearchValue] = useState('');
    
        // Normalize the input using the same logic as the header message
        const processedLoginForExclusion = useMemo(() => {
            const processedLogin = searchValue.trim().toLowerCase();
            return parsePhoneNumber(appendCountryCodeWithCountryCode(processedLogin, countryCode)).possible
                ? addSMSDomainIfPhoneNumber(appendCountryCodeWithCountryCode(processedLogin, countryCode))
                : processedLogin;
        }, [searchValue, countryCode]);
    
        const isExcludedLogin = !!excludedUsers[processedLoginForExclusion];
    
        const {searchTerm, setSearchTerm, availableOptions, selectedOptions, selectedOptionsForDisplay, toggleSelection, areOptionsInitialized, onListEndReached} = useSearchSelector({
            selectionMode: CONST.SEARCH_SELECTOR.SELECTION_MODE_MULTI,
            searchContext: CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_MEMBER_INVITE,
            includeUserToInvite: !isExcludedLogin,
            excludeLogins: excludedUsers,
            includeRecentReports: true,
            shouldInitialize: didScreenTransitionEnd,
        });

    const {searchTerm, setSearchTerm, availableOptions, selectedOptions, selectedOptionsForDisplay, toggleSelection, areOptionsInitialized, onListEndReached} = useSearchSelector({
    selectionMode: CONST.SEARCH_SELECTOR.SELECTION_MODE_MULTI,
    searchContext: CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_MEMBER_INVITE,
    includeUserToInvite: true,
    excludeLogins: excludedUsers,
    includeRecentReports: true,
    shouldInitialize: didScreenTransitionEnd,
    });

                    onChangeText={(val) => {
                        setSearchValue(val);
                        setSearchTerm(val);
                    }}

    onChangeText={setSearchTerm}

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    None

  5. added
    External
    on Sep 26, 2025
  6. changed the title [-]Chat -User can select and complete invite already member to group chat[/-] [+][$250] Chat -User can select and complete invite already member to group chat[/+] on Sep 26, 2025
  7. melvin-bot commented on Sep 26, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Sep 26, 2025
  9. melvin-bot commented on Sep 26, 2025

    @melvin-bot

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

  10. 27 remaining items

  11. melvin-bot commented on Oct 27, 2025

    @melvin-bot

    @heyjennahay Eep! 4 days overdue now. Issues have feelings too...

  12. heyjennahay commented on Oct 28, 2025

    @heyjennahay
    Contributor
  13. heyjennahay commented on Oct 28, 2025

    @heyjennahay
    Contributor

    Since there is no BZ checklist, manually adding it

    Confirming:

  14. heyjennahay commented on Oct 28, 2025

    @heyjennahay
    Contributor

    @nkdengineer can you please accept the Upwork offer here #71156 (comment) so I can arrange your payment? Restar me afterwards please

  15. nkdengineer commented on Oct 30, 2025

    @nkdengineer
    Contributor

    @heyjennahay I get paid via NewDot

  16. heyjennahay commented on Nov 3, 2025

    @heyjennahay
    Contributor

    Updating payment confirmation:

    • @jayeshmangwani please submit a payment request for $250 through NewDot
    • @nkdengineer please submit a payment request for $250 through NewDot
  17. melvin-bot commented on Nov 4, 2025

    @melvin-bot

    @jayeshmangwani Eep! 4 days overdue now. Issues have feelings too...

  18. twisterdotcom commented on Nov 5, 2025

    @twisterdotcom
    Contributor

    @jayeshmangwani has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-d68a-a676-992a-caea9e5f5411
  19. JmillsExpensify commented on Nov 7, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @nkdengineer

  20. jayeshmangwani commented on Nov 7, 2025

    @jayeshmangwani
    Contributor

    @heyjennahay I think there’s nothing pending for this issue. We’re good to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions