Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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
2 of 6 tasks
kbecciv opened this issue Oct 27, 2023 · 23 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Oct 27, 2023

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
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Oct 27, 2023
@OSBotify
Copy link
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.

@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

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

@ishpaul777
Copy link
Contributor

ishpaul777 commented Oct 27, 2023

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.

@marcaaron
Copy link
Contributor

cc @luacmartins

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

@luacmartins
Copy link
Contributor

Agreed that it should accept both.

@luacmartins luacmartins assigned luacmartins and unassigned Li357 Oct 27, 2023
@luacmartins
Copy link
Contributor

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

@ishpaul777
Copy link
Contributor

yes i am available

@luacmartins luacmartins added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 27, 2023
@luacmartins luacmartins assigned ishpaul777 and unassigned maddylewis Oct 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

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

@melvin-bot

This comment was marked as off-topic.

@luacmartins
Copy link
Contributor

It's yours! Please tag me for review

@luacmartins luacmartins added the External Added to denote the issue can be worked on by a contributor label Oct 27, 2023
@melvin-bot melvin-bot bot changed the title Contact methods - Fix the errors CTA in Add new contact method page crashes the app [$500] Contact methods - Fix the errors CTA in Add new contact method page crashes the app Oct 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0131fa74ee0414e807

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

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

@luacmartins luacmartins removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 27, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Oct 27, 2023
@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Oct 27, 2023
@luacmartins
Copy link
Contributor

Fix is being CPed. Keeping this issue open to process payment.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 30, 2023
@melvin-bot melvin-bot bot changed the title [$500] Contact methods - Fix the errors CTA in Add new contact method page crashes the app [HOLD for payment 2023-11-06] [$500] Contact methods - Fix the errors CTA in Add new contact method page crashes the app Oct 30, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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

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:

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

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:

  • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@abdulrahuman5196] 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.
  • [@maddylewis] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abdulrahuman5196
Copy link
Contributor

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 31, 2023
@melvin-bot melvin-bot bot 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 Oct 31, 2023
Copy link

melvin-bot bot commented Oct 31, 2023

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:

This comment was marked as off-topic.

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Nov 5, 2023
@luacmartins
Copy link
Contributor

Just pending payment

@melvin-bot melvin-bot bot removed the Overdue label Nov 8, 2023
@maddylewis
Copy link
Contributor

maddylewis commented Nov 8, 2023

Payments

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

@maddylewis
Copy link
Contributor

offers sent ($500 via Upwork)

@maddylewis
Copy link
Contributor

paid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants