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 2024-02-14] [$500] [Wave 5] [ECard Settings] App crashes when pressing back button when activating physical expensify card #34875
Alternatively (if on dev) you can add this effect to WalletPage.js to create a mock card:
Navigate to the WalletPage
Navigate to Expensify Card
Click the Activate physical card button
The native keyboard is necessary for reproduction but it will be closed by default, to enable it you have to manually focus some digit of the activation code (e.g. the 4th one), that should toggle the native keyboard
Once the native keyboard is toggled, dismiss it by pressing anywhere on the screen
Once it’s dismissed press the < button on the screen keyboard (the custom one)
Expected Result:
App should not crash
Actual Result:
App crashed
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]App crashes when pressing back button when activating physical expensify card[/-][+][$500] App crashes when pressing back button when activating physical expensify card[/+]on Jan 22, 2024
changed the title [-][$500] App crashes when pressing back button when activating physical expensify card[/-][+][Wave 5] App crashes when pressing back button when activating physical expensify card[/+]on Jan 22, 2024
Please re-state the problem that we are trying to solve in this issue.
The app crashes if a user presses the Backspace button on the Big Number Pad (BNP) after dismissing the soft keyboard on a native device.
What is the root cause of that problem?
Tapping anywhere to dismiss the soft keyboard causes the MagicCodeInput to lose focus, thereby calling setFocusedIndex(undefined); to null in the onBlur handler.
Note that this will also cause the soft keyboard to be displayed again every time the input regains focus, so we would need to add a ref to check if the soft keyboard has already been dismissed to prevent it from being shown again while the screen is still active.
What alternative solutions did you explore? (Optional)
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.37-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
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:
[@akinwale / @DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
[@akinwale / @DylanDylann] 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:
[@akinwale / @DylanDylann] 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:
[@akinwale / @DylanDylann] Determine if we should create a regression test for this bug.
[@akinwale / @DylanDylann] 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.
[] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
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:
[@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: NA
[@DylanDylann] 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: NA
[@DylanDylann] 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: NA
[@DylanDylann] Determine if we should create a regression test for this bug. Yes
[@DylanDylann] 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.
Regression Test Proposal
Launch the Expensify app.
Navigate to the Wallet page.
Click or tap on the Activate physical card button.
Dismiss the soft keyboard that is shown so that the magic code input loses focus. (The soft keyboard showing up and getting dismissed is a required step for the test).
Press the Backspace button at the bottom right of the BNP.
Issue is ready for payment but no BZ is assigned. @greg-schroeder you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
Activity
[-]App crashes when pressing back button when activating physical expensify card[/-][+][$500] App crashes when pressing back button when activating physical expensify card[/+]melvin-bot commentedon Jan 22, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01a4febea3f9721613
[-][$500] App crashes when pressing back button when activating physical expensify card[/-][+][Wave 5] App crashes when pressing back button when activating physical expensify card[/+]akinwale commentedon Jan 22, 2024
Is there a video of the test steps to reproduce the bug?
akinwale commentedon Jan 22, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The app crashes if a user presses the Backspace button on the Big Number Pad (BNP) after dismissing the soft keyboard on a native device.
What is the root cause of that problem?
Tapping anywhere to dismiss the soft keyboard causes the MagicCodeInput to lose focus, thereby calling
setFocusedIndex(undefined);to null in theonBlurhandler.App/src/components/MagicCodeInput.js
Line 390 in 1d21e28
Upon the next press of the Backspace button, we're trying to focus on a non-existent ref which triggers the error.
App/src/components/MagicCodeInput.js
Line 280 in 1d21e28
What changes do you think we should make in order to solve the problem?
Solution 1
Check that the
indexToFocusis not undefined before calling thefocusmethod in MagicCodeInput.Solution 2
Ensure that the MagicCodeInput is focused before dispatching a key press from the BNP.
We can do this in the
updateLastPressedDigitcallback in ActivatePhysicalCardPage.App/src/pages/settings/Wallet/ActivatePhysicalCardPage.js
Line 101 in 1d21e28
Note that this will also cause the soft keyboard to be displayed again every time the input regains focus, so we would need to add a ref to check if the soft keyboard has already been dismissed to prevent it from being shown again while the screen is still active.
What alternative solutions did you explore? (Optional)
None.
akinwale commentedon Jan 22, 2024
Proposal
Updated
situchan commentedon Jan 22, 2024
Seems like the same root cause as #18874
akinwale commentedon Jan 22, 2024
Yeah, looks like it. However, the underlying cause of that issue was fixed. This is triggered due to expected user action.
32 remaining items
melvin-bot commentedon Feb 7, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Feb 7, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.37-7 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 2024-02-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Feb 7, 2024
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:
DylanDylann commentedon Feb 14, 2024
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:
[@DylanDylann] The PR that introduced the bug has been identified. Link to the PR: NA
[@DylanDylann] 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: NA
[@DylanDylann] 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: NA
[@DylanDylann] Determine if we should create a regression test for this bug. Yes
[@DylanDylann] 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.
Regression Test Proposal
Do we agree 👍 or 👎
melvin-bot commentedon Feb 14, 2024
Issue is ready for payment but no BZ is assigned. @greg-schroeder you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
greg-schroeder commentedon Feb 14, 2024
Paid, filed regression test, closing