-
Notifications
You must be signed in to change notification settings - Fork 3k
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-10-23] [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$1000] IOU - Selecting currency in BNP and pressing "CMD+ENTER" results in accidental redirection #23395
Comments
Triggered auto assignment to @MitchExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The existing issue lies in the currency selection functionality of the app. After selecting currency for a money request in a chat room, a combination of "CMD+ENTER" keys results in an unwanted redirection to a random chat room, instead of just closing the currency selection menu and returning to the previous window. What is the root cause of that problem?The cause of the problem appears to be tied to the handling of the "CMD+ENTER" key combination in the app. Currently, the event listener in the currency selection menu is not configured to properly handle this key combination, leading to the accidental redirection. What changes do you think we should make in order to solve the problem?To address this issue, we need to modify the code in the CurrencySymbolButton.js file. App/src/components/CurrencySymbolButton.js Lines 20 to 32 in b7d17e0
Here's the proposed code modification to handle the "CMD+ENTER" key combination, prevent the default behavior (which is triggering the form submission) and close the currency selection modal: function CurrencySymbolButton(props) {
const handleKeyDown = (event) => {
if (event.metaKey && event.key === 'Enter') {
event.preventDefault();
props.onCurrencyButtonPress();
}
};
return (
<Tooltip text={props.translate('iOUCurrencySelection.selectCurrency')}>
<PressableWithoutFeedback
onPress={props.onCurrencyButtonPress}
accessibilityLabel={props.translate('iOUCurrencySelection.selectCurrency')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
onKeyDown={handleKeyDown} // Added the keydown event listener here
>
... What alternative solutions did you explore? (Optional)None. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing CMD+Enter while selecting the currency closes the modal. What is the root cause of that problem?In the App/src/components/OptionsSelector/BaseOptionsSelector.js Lines 91 to 93 in b7d17e0
The callback is executed twice due to a bug in Subsequently, What changes do you think we should make in order to solve the problem?We should ensure that the input modifiers are correctly checked in - if (!validatedKeyCommand.modifierFlags && isInputMatched) {
+ if (!validatedKeyCommand.modifierFlags && isInputMatched && isCommandMatched) { Instead of the two if-statements contained in this function, we can also simplify this by combining them to: What alternative solutions did you explore? (Optional)Alternatively, we can add a debounce time to prevent the callback from being executed twice. |
@mountiny buddy check on this keyboard command actually being a platform wide expectation the same as hitting "Enter" on its own |
@MitchExpensify I am not sure about this one, seems like a niche edge case where I am not sure if we should worry about. |
@azimgd from your experience, have we been catching such flows before? |
@MitchExpensify Only pressing Enter does not trigger the event listening to CMD+Enter. It's when the combination is pressed that both are processed, leading to a double execution of the callback. It's a general problem when listening to a combination of keys where modifiers are involved. |
Yeah so I think if we want to solve this it would have to be in general |
I traced it back to the |
Ok cool, as long as we solve in general this seems worth fixing |
Job added to Upwork: https://www.upwork.com/jobs/~015204edc11a150c2b |
Current assignee @MitchExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
Not overdue, Melvin |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.83-11 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-10-20. 🎊 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: As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.83-11 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-10-20. 🎊 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: As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 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-10-23. 🎊 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: As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 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-10-23. 🎊 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: As a reminder, here are the bonuses/penalties that should be applied for any External 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:
|
Wow whats up Melvin! Is this actually being held for payment at this point? |
Expensify/react-native-key-command#5 There's also another PR in the E/App that causing the issue, because it got resolve before the fix in upstream merged.
The regression step should be enough.
|
Mind helping me understand if the fix has been on prod for 7 days without regression @mollfpr? The Melvin updates are causing me doubt |
@MitchExpensify The PR is included in the production release: https://github.com/Expensify/App/releases/tag/1.3.83-11, which is on Oct 14th. |
Mind taking a peak at the BZ steps @johnmlee101 #23395 (comment) 👀 |
@MitchExpensify I already have the Upwork contract. |
Paid and contracts ended! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The modal window of currency selection should close and the user should get to the previous window of currency amount input with correctly selected currency
Actual Result:
The modal currency selection window closes and the user is redirected to a random chat
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.44.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Notes/Photos/Videos: Any additional supporting documentation
Bug6137428_Recording__104.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Inernal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: