Skip to content

[HOLD for payment 2023-11-07] [HOLD for payment 2023-11-06] [$500] Contact methods - Fix the errors CTA in Add new contact method page crashes the app #30510

Closed

Description

@kbecciv

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.3.92.0
Reproducible in staging?: y
Reproducible in production?: n
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: Applause - Internal Team
Slack conversation:

Issue found when executing PR #29869

Note: Crash is reproducible on Android and iOS app.
On web and desktop, console error shows up.

Action Performed:

  1. Launch New Expensify app.
  2. Go to Settings > Profile > Contact methods.
  3. Click New contact method.
  4. Enter an invalid email.
  5. Click Save.
  6. Click Fix the errors.

Expected Result:

App does not crash.

Actual Result:

App crashes.

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

Android: Native
Bug6253053_1698397438060.Screen_Recording_20231027_102606_One_UI_Home.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0131fa74ee0414e807
  • Upwork Job ID: 1717976360459390976
  • Last Price Increase: 2023-10-27

Activity

  1. OSBotify commented on Oct 27, 2023

    @OSBotify
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  2. melvin-bot commented on Oct 27, 2023

    @melvin-bot

    Triggered auto assignment to @Li357 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  3. ishpaul777 commented on Oct 27, 2023

    @ishpaul777
    Contributor

    Problem

    Issue: The "Add new contact" (CTA) in the "Add new contact method" page is causing the app to crash.

    Root Cause

    The root cause of the issue is related to the registerInput function used in the InputWrapper component. It appears that registerInput is designed to accept a ref object, not a function. When the onFixTheErrorsLinkPressed function is triggered here, the focusInput becomes undefined because it's accessed as inputRefs.current[focusKey].current and inputRefs.current[focusKey] is a function and while focusInput.isFocusedis accessed here app crashes.

    Changes

    There are two possible solutions to address this issue:

    Temporary Solution

    A temporary solution would be to pass the ref like this in the NewContactMethodPage.js file:

    ref={loginInputRef}

    Instead of:

    ref={(el) => (loginInputRef.current = el)}

    This temporary solution can be applied quickly to prevent the app from crashing.

    Alternative Solution

    An alternative solution would involve modifying the registerInput function to support function-based refs. This modification can be implemented in the FormProvider. Here's the proposed change in the FormProvider:

    ref: typeof newRef === 'function' ? (node) => {
        newRef(node);
        const inputRef = createRef();
        inputRef.current = node;
        inputRefs.current[inputID] = inputRef;
    } : newRef,

    With these changes, the registerInput function would be able to handle both ref objects and function-based refs, and the issue causing the app to crash should be resolved.

    Please note that the alternative solution might require more changes but could be a more robust and long-term fix for this issue.

  4. marcaaron commented on Oct 27, 2023

    @marcaaron
    Contributor

    cc @luacmartins

    I think we should accept both object or function (alternative solution).

  5. luacmartins commented on Oct 27, 2023

    @luacmartins
    Contributor

    Agreed that it should accept both.

  6. luacmartins commented on Oct 27, 2023

    @luacmartins
    Contributor

    @ishpaul777 are you available to work on the alternate solution fix in the next few minutes?

  7. ishpaul777 commented on Oct 27, 2023

    @ishpaul777
    Contributor

    yes i am available

  8. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 27, 2023
  9. 26 remaining items

  10. abdulrahuman5196 commented on Oct 30, 2023

    @abdulrahuman5196
    Contributor

    I didn't review the PR actually. It was reviewed internally.

  11. changed the title [-][HOLD for payment 2023-11-06] [$500] Contact methods - Fix the errors CTA in Add new contact method page crashes the app[/-] [+][HOLD for payment 2023-11-07] [HOLD for payment 2023-11-06] [$500] Contact methods - Fix the errors CTA in Add new contact method page crashes the app[/+] on Oct 31, 2023
  12. melvin-bot commented on Oct 31, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.93-1 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 2023-11-07. 🎊

    After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

    • External issue reporter
    • Contributor that fixed the issue
    • Contributor+ that helped on the issue and/or PR

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

  13. melvin-bot commented on Oct 31, 2023

    @melvin-bot
  14. luacmartins commented on Nov 8, 2023

    @luacmartins
    Contributor

    Just pending payment

  15. maddylewis commented on Nov 8, 2023

    @maddylewis
    Contributor

    Payments

    @luacmartins - does that look right to you? i couldn't see when the contributor was hired / if anyone is eligible for urgency bonus.

  16. maddylewis commented on Nov 8, 2023

    @maddylewis
    Contributor

    offers sent ($500 via Upwork)

  17. maddylewis commented on Nov 8, 2023

    @maddylewis
    Contributor

    paid

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.DailyKSv2EngineeringExternalAdded 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