Skip to content

[HOLD for payment 2024-02-14] [$500] Long pressing "Go to Expensify Classic" option in Settings Crashes the App #35310

Closed

Description

@m-natarajan

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: 1.4.32-2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @ishpaul777
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1706307323470669

Action Performed:

  1. Go to settings
  2. Long press Go to expensify classic

Expected Result:

App should not crash

Actual Result:

App crashed

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

RPReplay_Final1706302579.MP4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017b2c107d082607ce
  • Upwork Job ID: 1751947232616599552
  • Last Price Increase: 2024-01-29
  • Automatic offers:
    • ishpaul777 | Contributor | 28134405

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 29, 2024
  2. melvin-bot commented on Jan 29, 2024

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Jan 29, 2024

    @melvin-bot
  4. changed the title [-]Long pressing "Go to Expensify Classic" option in Settings Crashes the App[/-] [+][$500] Long pressing "Go to Expensify Classic" option in Settings Crashes the App[/+] on Jan 29, 2024
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 29, 2024
  6. melvin-bot commented on Jan 29, 2024

    @melvin-bot

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

  7. ishpaul777 commented on Jan 29, 2024

    @ishpaul777
    Contributor

    Proposal

    Problem Statement

    Users are experiencing app crashes when performing a long press on the "Go to Expensify Classic" option in Settings.

    Root Cause

    We are not using Link.buildOldDotURL properly in the getDefaultMenuItems in the InitialSettingsPage. The function returns a promise instead of a string, leading to unexpected behavior and crash.

    link: Link.buildOldDotURL(CONST.OLDDOT_URLS.INBOX),

    Proposed Solution

    To address the problem, we should handle the link properly similar to what we have done for MenuItemList:

    link: Link.buildOldDotURL(CONST.OLDDOT_URLS.INBOX),

    to:

     link: () => Link.buildOldDotURL(CONST.OLDDOT_URLS.INBOX), 
    

    const secondaryInteraction = (link: MenuItemLink | undefined, event: GestureResponderEvent | MouseEvent) => {
    if (typeof link === 'function') {
    link().then((url) => ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK, event, url, popoverAnchor.current));
    } else if (link) {
    ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK, event, link, popoverAnchor.current);
    }
    };

    // src/pages/settings/InitialSettingsPage.js
    
    const onSecondaryInteraction = (link, event) => {
        if (typeof link === 'function') {
            console.debug('InitialSettingsPage: secondaryInteraction: link is a function, executing it');
            link().then((url) => ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK, event, url, popoverAnchor.current));
        } else if (link) {
            ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK, event, link, popoverAnchor.current);
        }
    };
    
    <MenuItem
        // rest of props
        onSecondaryInteraction={item.link !== undefined ? (e) => onSecondaryInteraction(item.link, e) : undefined}
    />
  8. samilabud commented on Jan 29, 2024

    @samilabud
    Contributor

    Proposal

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

    Secondary action for button "Go to Expensify Classic" in Settings Crashes the App

    What is the root cause of that problem?

    We are using buildOldDotURL method as secondary action, but this return an promise-string and we are expecting just a string, this cause that our ReportActionContextMenu.showContextMenu rise the error.

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

    We should make the same as our main action and call the openOldDotLink method.

    Something like:

              {
                    translationKey: 'initialSettingsPage.goToExpensifyClassic',
                    icon: Expensicons.NewExpensify,
                    action: () => {
                        Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
                    },
                    shouldShowRightIcon: true,
                    iconRight: Expensicons.NewWindow,
                    link: () => Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX),
                },
    

    Result:

    long.pressing.crashes.the.app.test.mp4
  9. mananjadhav commented on Jan 30, 2024

    @mananjadhav
    Collaborator

    @ishpaul777's proposal looks good.

    🎀 👀 🎀 C+ reviewed.

  10. melvin-bot commented on Jan 30, 2024

    @melvin-bot

    Triggered auto assignment to @nkuoch, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  11. 17 remaining items

  12. melvin-bot commented on Feb 7, 2024

    @melvin-bot

    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:

    • [@mananjadhav / @ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
    • [@mananjadhav / @ishpaul777] 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:
    • [@mananjadhav / @ishpaul777] 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:
    • [@mananjadhav / @ishpaul777] Determine if we should create a regression test for this bug.
    • [@mananjadhav / @ishpaul777] 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.
    • [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  13. mananjadhav commented on Feb 12, 2024

    @mananjadhav
    Collaborator

    I tried finding the root PR, the best one where we refactored the links in InitialSettingsPage is this PR. @ishpaul777 if you could identify the offending PR?

    I don't think we need a regression test for this one.

  14. sonialiap commented on Feb 14, 2024

    @sonialiap
    Contributor

    @mananjadhav $500 - please request via ND
    @ishpaul777 Contributor - $500 paid ✔️ (not sure why melvin decided there should be two offers. In fact looks like it might have duplicated by accident)

  15. JmillsExpensify commented on Feb 14, 2024

    @JmillsExpensify
    Contributor

    $500 approved for @mananjadhav based on summary above.

  16. ishpaul777 commented on Feb 14, 2024

    @ishpaul777
    Contributor

    not sure why melvin decided there should be two offers. In fact looks like it might have duplicated by accident

    could be because i reported the bug also, maybe there is still bug report bounty automation in place for these messages?

  17. ishpaul777 commented on Feb 14, 2024

    @ishpaul777
    Contributor

    @ishpaul777 if you could identify the offending PR?

    sorry missed this earlier, will look into this

  18. ishpaul777 commented on Feb 16, 2024

    @ishpaul777
    Contributor

    This PR https://github.com/Expensify/App/pull/32947/files added a new menu item in settings page and this one is the offending PR #33863 to be specific

  19. sonialiap commented on Feb 16, 2024

    @sonialiap
    Contributor

    @mananjadhav @ishpaul777 could you please complete the checklist :)

  20. ishpaul777 commented on Feb 16, 2024

    @ishpaul777
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Fix/32875/svg color and olddot url #33863
    • 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/33863/files#r1492831004
    • 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: not required
    • Determine if we should create a regression test for this bug. not required
    • 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. - not required
  21. ishpaul777 commented on Feb 19, 2024

    @ishpaul777
    Contributor

    not overdue, we can close this now

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions