Skip to content

[Due for payment 2025-08-26] [$250] Chat - iOS - Double tapping on a contact opens the chat twice #67917

Closed

Description

@lanitochka17

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.1.89-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the app
  2. Log in with a new Gmail account
  3. Finish onboarding with the "Track" option
  4. Navigate to FAB - Start chat
  5. Input the email address of an existing Gmail account
  6. Double tap on the account under "Contacts"
  7. Tap on the "<" button

Expected Result:

The chat should be opened once

Actual Result:

Double tapping on a contact opens the chat twice. Navigating back will result in an endless skeleton loader

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6908297_1754393482705.DGTF5307.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021955224670854960116
  • Upwork Job ID: 1955224670854960116
  • Last Price Increase: 2025-08-12
Issue OwnerCurrent Issue Owner: @zanyrenney

Activity

  1. added
    Daily
    Bug
    on Aug 5, 2025
  2. melvin-bot commented on Aug 5, 2025

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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. Eskalifer1 commented on Aug 5, 2025

    @Eskalifer1
    Contributor

    Proposal

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

    Chat - iOS - Double tapping on a contact opens the chat twice

    What is the root cause of that problem?

    This happens because we use a listener for the keyboard, and when the keyboard is open, it is possible to call the Keyboard.dismiss() function twice, which will add two listeners, and when the keyboard is hidden, two calls to the function will occur. When the keyboard is closed, the bug does not reproduce.

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

    To fix this bug, we need to add a flag that will indicate that the function has already been called:

        const isHandlingPress = useRef(false);
    
        /**
         * If there are selected options already then it will toggle the option otherwise
         * creates a new 1:1 chat with the option and the current user,
         * or navigates to the existing chat if one with those participants already exists.
         */
        const selectOption = useCallback(
            (option?: Option) => {
                if (option?.isSelfDM) {
                    if (!option.reportID) {
                        Navigation.dismissModal();
                        return;
                    }
                    Navigation.dismissModalWithReport({reportID: option.reportID});
                    return;
                }
                if (selectedOptions.length && option) {
                    // Prevent excluded emails from being added to groups
                    if (option?.login && excludedGroupEmails.includes(option.login)) {
                        return;
                    }
                    toggleOption(option);
                    return;
                }
    
                let login = '';
    
                if (option?.login) {
                    login = option.login;
                } else if (selectedOptions.length === 1) {
                    login = selectedOptions.at(0)?.login ?? '';
                }
                if (!login) {
                    Log.warn('Tried to create chat with empty login');
                    return;
                }
    
                if (isHandlingPress.current) return;
                isHandlingPress.current = true;
                KeyboardUtils.dismiss().then(() => {
                    navigateToAndOpenReport([login]);
                    isHandlingPress.current = false;
                });
            },
            [selectedOptions, toggleOption],
        );

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

    N/A

    What alternative solutions did you explore? (Optional)

    1. We can replace KeyboardUtils.dismiss() with simply Keyboard.dismiss() and possibly call the function with a certain delay, but we will need to check if there are any drawbacks to this approach.

    2. We can wrap the function in a throttle with a large value (for example, 5 seconds), in which case the function will be called only once.
      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. melvin-bot commented on Aug 8, 2025

    @melvin-bot

    @zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. added
    External
    on Aug 12, 2025
  6. changed the title [-]Chat - iOS - Double tapping on a contact opens the chat twice[/-] [+][$250] Chat - iOS - Double tapping on a contact opens the chat twice[/+] on Aug 12, 2025
  7. melvin-bot commented on Aug 12, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Aug 12, 2025
  9. melvin-bot commented on Aug 12, 2025

    @melvin-bot

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

  10. zanyrenney commented on Aug 12, 2025

    @zanyrenney
    Contributor

    Hey @ishpaul777 please can you review the proposal above?

  11. 23 remaining items

  12. added
    Awaiting Payment
    on Aug 19, 2025
  13. changed the title [-][$250] Chat - iOS - Double tapping on a contact opens the chat twice[/-] [+][Due for payment 2025-08-26] [$250] Chat - iOS - Double tapping on a contact opens the chat twice[/+] on Aug 19, 2025
  14. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. removed
    Reviewing
    on Aug 19, 2025
  16. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.96-2 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-08-26. 🎊

    For reference, here are some details about the assignees on this issue:

    • @Eskalifer1 requires payment (Needs manual offer from BZ)
    • @ishpaul777 requires payment through NewDot Manual Requests
  17. melvin-bot commented on Aug 19, 2025

    @melvin-bot

    @ishpaul777 @zanyrenney 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]

  18. added
    Daily
    and removed
    Weekly
    on Aug 25, 2025
  19. zanyrenney commented on Aug 26, 2025

    @zanyrenney
    Contributor

    Hey @ishpaul777 please complete the checklist so that we can proceed with the payout.

  20. zanyrenney commented on Aug 26, 2025

    @zanyrenney
    Contributor

    I have sent a message via DM to @ishpaul777

  21. melvin-bot commented on Aug 26, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@zanyrenney)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1955224670854960116/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  22. ishpaul777 commented on Aug 27, 2025

    @ishpaul777
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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: not introduced by a specific PR, edge case bug never considered

    • [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: rare edge case not CRITICAL, no need

    • [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. rare edge case not CRITICAL, no need

  23. zanyrenney commented on Aug 27, 2025

    @zanyrenney
    Contributor

    Payment summary

    ROLE: @Eskalifer1 paid $(AMOUNT) via Upwork (LINK) - paid $250 via upwork
    Reviewer: @ishpaul777 owed $250 via NewDot - please request on ND

  24. trjExpensify commented on Sep 29, 2025

    @trjExpensify
    Contributor

    approved $250 for @ishpaul777

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions