Skip to content

[Due for payment 2025-06-18] [$250] Account-Tapping Preferences & quickly long press "Help" shows copy clipboard in Preferences #63231

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.1.54-6
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: N/a
Email or phone of affected tester (no customers): applausetester@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13
App Component: User Settings

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Tap account
  3. Tap Preferences and quickly long press "Help" & take the finger when page transitioned to Preferences

Expected Result:

Tapping Preferences & quickly long press "Help" must not show copy url to clipboard in Preferences page.

Actual Result:

Tapping Preferences & quickly long press "Help" shows copy url to clipboard in Preferences page.

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

Bug6847126_1748664761342.Screenrecorder-2025-05-31-09-34-34-644.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021929948650884448017
  • Upwork Job ID: 1929948650884448017
  • Last Price Increase: 2025-06-03
  • Automatic offers:
    • JoshIri360 | Contributor | 107573093
Issue OwnerCurrent Issue Owner: @lydiabarclay

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 2, 2025
  2. melvin-bot commented on Jun 2, 2025

    @melvin-bot

    Triggered auto assignment to @lydiabarclay (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. MobileMage commented on Jun 2, 2025

    @MobileMage
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-06-02 06:55:05 UTC.

    Proposal

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

    When a user taps on Preferences and quickly long-presses the Help button during the page transition, the "copy to clipboard" context menu incorrectly appears on the Preferences page instead of being blocked. This creates a confusing user experience where an unintended context menu from a different page shows up after navigation completes.

    What is the root cause of that problem?

    The root cause is an overly broad route check in the openPopover function that allows the context menu to appear on any settings page, not just the root settings page. The current code uses Navigation.getActiveRoute().includes(ROUTES.SETTINGS)

    const openPopover = (link: string | (() => Promise<string>) | undefined, event: GestureResponderEvent | MouseEvent) => {
    if (!Navigation.getActiveRoute().includes(ROUTES.SETTINGS)) {
    return;
    }

    which matches both the initial settings page and nested pages like Preferences. When the user performs the quick tap-and-long-press gesture, the long press event from the Help button gets triggered while the route is transitioning from the initial settings page to the Preferences page. Since both routes contain "settings", the check passes and the context menu appears on the wrong page.

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

    We should replace the broad route check with an exact route match using the existing Navigation.isActiveRoute() method. Instead of Navigation.getActiveRoute().includes(ROUTES.SETTINGS) which matches any route containing "settings", we should use Navigation.isActiveRoute(ROUTES.SETTINGS) which performs an exact match only for the root settings page. The isActiveRoute method already handles route normalization and cleanup, ensuring the context menu only appears when the user is actually on the initial settings page, not on nested settings pages like Preferences.

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

    Testing the specific gesture sequence of tapping Preferences and immediately long-pressing Help to ensure no context menu appears on the Preferences page.

    What alternative solutions did you explore? (Optional)

    We considered using component mounted state tracking but chose the route-based approach since it directly addresses the routing logic issue without adding unnecessary complexity.

  4. linhvovan29546 commented on Jun 2, 2025

    @linhvovan29546
    Contributor

    Proposal

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

    Account-Tapping Preferences & quickly long press "Help" shows copy clipboard in Preferences

    What is the root cause of that problem?

    When navigating, there's a slight delay due to the animation transition. During this delay, the longPress event can still be triggered. In this case, the longPress event triggers openPopover to show the "Copy to clipboard" context menu, even though the page is navigating away.

    We already have a condition to prevent this, but it’s wrong for this case since activeRoute is '/settings/preferences'

    const openPopover = (link: string | (() => Promise<string>) | undefined, event: GestureResponderEvent | MouseEvent) => {
    if (!Navigation.getActiveRoute().includes(ROUTES.SETTINGS)) {
    return;
    }

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

    Update the conditional check to ensure the context menu doesn't show

    const openPopover = (link: string | (() => Promise<string>) | undefined, event: GestureResponderEvent | MouseEvent) => {
    if (!Navigation.getActiveRoute().includes(ROUTES.SETTINGS)) {
    return;
    }

                 const activeRoute= Navigation.getActiveRoute();
                    if (activeRoute !==`/${ROUTES.SETTINGS}`) {
                        return;
                    }

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

    This might not be strictly necessary, but if we want to add a test, we could:

    • Render InitialSettingsPage.
    • Mock Navigation.getActiveRoute() to return a different route.
    • Trigger onSecondaryInteraction.
    • Assert that showContextMenu is not called.

    What alternative solutions did you explore? (Optional)

    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.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 3, 2025
  6. melvin-bot commented on Jun 3, 2025

    @melvin-bot
  7. changed the title [-]Account-Tapping Preferences & quickly long press "Help" shows copy clipboard in Preferences[/-] [+][$250] Account-Tapping Preferences & quickly long press "Help" shows copy clipboard in Preferences[/+] on Jun 3, 2025
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 3, 2025
  9. melvin-bot commented on Jun 3, 2025

    @melvin-bot

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

  10. Ollyws commented on Jun 5, 2025

    @Ollyws
    Contributor

    @JoshIri360's proposal LGTM.
    🎀👀🎀 C+ reviewed

  11. 19 remaining items

  12. changed the title [-][$250] Account-Tapping Preferences & quickly long press "Help" shows copy clipboard in Preferences[/-] [+][Due for payment 2025-06-18] [$250] Account-Tapping Preferences & quickly long press "Help" shows copy clipboard in Preferences[/+] on Jun 11, 2025
  13. melvin-bot commented on Jun 11, 2025

    @melvin-bot

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

  14. melvin-bot commented on Jun 11, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.64-5 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-06-18. 🎊

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

    • @Ollyws requires payment through NewDot Manual Requests
    • @MobileMage requires payment (Needs manual offer from BZ)
  15. melvin-bot commented on Jun 11, 2025

    @melvin-bot

    @Ollyws @lydiabarclay @Ollyws 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]

  16. melvin-bot commented on Jun 18, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    • Reviewer: @Ollyws owed $250 via NewDot
    • ROLE: @MobileMage paid $(AMOUNT) via Upwork (LINK)

    BugZero Checklist (@lydiabarclay)

    • 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/1929948650884448017/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  17. MobileMage commented on Jun 18, 2025

    @MobileMage
    Contributor
  18. Ollyws commented on Jun 18, 2025

    @Ollyws
    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
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on both staging and production
    • 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: https://github.com/Expensify/App/pull/61227/files#r2154321841

    • [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:

    • [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.

    Regression Test Proposal Template

    Regression Test Proposal

    Precondition:

    Test:

    1. Navigate to Settings - Open the main Settings page and verify Help button context menu works correctly on this page
    2. Quick Navigation Test - Tap "Preferences" and immediately long-press the Help button during page transition
    3. Verify No Context Menu - Confirm that no "copy to clipboard" context menu appears on the Preferences page
    

    Do we agree 👍 or 👎

  19. lydiabarclay commented on Jun 18, 2025

    @lydiabarclay
    Contributor

    Payment Summary

    Contributor: @MobileMage paid $250 via Upwork
    Contributor+: @Ollyws due $250 via NewDot

    ✅ Regression test filed

  20. Ollyws commented on Jun 18, 2025

    @Ollyws
    Contributor

    Requested on ND.

  21. garrettmknight commented on Jun 19, 2025

    @garrettmknight
    Contributor

    $250 approved for @Ollyws

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions