You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[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
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:
👋 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:
Identify the pull request that introduced this issue and revert it.
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:
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.
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
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:
Activity
OSBotify commentedon Oct 27, 2023
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
StagingDeployCashdeploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:melvin-bot commentedon Oct 27, 2023
Triggered auto assignment to @Li357 (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.ishpaul777 commentedon 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
registerInputfunction used in theInputWrappercomponent. It appears thatregisterInputis designed to accept a ref object, not a function. When theonFixTheErrorsLinkPressedfunction is triggered here, thefocusInputbecomesundefinedbecause it's accessed asinputRefs.current[focusKey].currentandinputRefs.current[focusKey]is a function and whilefocusInput.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
reflike this in theNewContactMethodPage.jsfile:Instead of:
This temporary solution can be applied quickly to prevent the app from crashing.
Alternative Solution
An alternative solution would involve modifying the
registerInputfunction to support function-based refs. This modification can be implemented in theFormProvider. Here's the proposed change in theFormProvider:With these changes, the
registerInputfunction 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 commentedon Oct 27, 2023
cc @luacmartins
I think we should accept both object or function (alternative solution).
luacmartins commentedon Oct 27, 2023
Agreed that it should accept both.
luacmartins commentedon Oct 27, 2023
@ishpaul777 are you available to work on the alternate solution fix in the next few minutes?
ishpaul777 commentedon Oct 27, 2023
yes i am available
26 remaining items
abdulrahuman5196 commentedon Oct 30, 2023
I didn't review the PR actually. It was reviewed internally.
[-][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[/+]melvin-bot commentedon 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.
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Oct 31, 2023
luacmartins commentedon Nov 8, 2023
Just pending payment
maddylewis commentedon 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 commentedon Nov 8, 2023
offers sent ($500 via Upwork)
maddylewis commentedon Nov 8, 2023
paid