-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2024-02-14] [$500] [Wave 5] [ECard Settings] App crashes when pressing back button when activating physical expensify card #34875
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01a4febea3f9721613 |
Is there a video of the test steps to reproduce the bug? |
ProposalPlease 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 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 +if (!indexToFocus) {
+ return;
+}
inputRefs.current[indexToFocus].focus(); Solution 2 We can do this in the
-const updateLastPressedDigit = useCallback((key) => setLastPressedDigit(lastPressedDigit === key ? lastPressedDigit + key : key), [lastPressedDigit]);
+const updateLastPressedDigit = useCallback((key) => {
+ if (activateCardCodeInputRef.current) {
+ activateCardCodeInputRef.current.focus();
+ }
+ setLastPressedDigit(lastPressedDigit === key ? lastPressedDigit + key : key);
+
+}, [lastPressedDigit]); 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. |
Proposal |
Seems like the same root cause as #18874 |
Yeah, looks like it. However, the underlying cause of that issue was fixed. This is triggered due to expected user action. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
@grgia, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@akinwale Could you reproduce this issue? I can't reproduce anymore Screen.Recording.2024-01-29.at.23.49.17.mov |
You need to press the Backspace button on the number pad to reproduce, not the back navigation button. |
@akinwale Could you help to point out |
@DylanDylann Circled in red. |
@akinwale In the PR phrase, could you also find out other places that also use the number pad? And verify that similar bugs also be fixed. |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @akinwale 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
All yours @akinwale! |
@DylanDylann My PR is ready for review. |
|
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:
|
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:
|
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 Regression Test Proposal
Do we agree 👍 or 👎 |
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! |
Paid, filed regression test, closing |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number:
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
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: @mountiny
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1705661461207919
Action Performed:
Prerequisites:
Expected Result:
App should not crash
Actual Result:
App crashed
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: