-
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 2023-10-23] [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-20] [HOLD for payment 2023-10-20] [$2000] Unable to change the currency after double-clicking on the current currency #22497
Comments
Triggered auto assignment to @maddylewis ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Unable to change the currency after double-clicking on the current currency What is the root cause of that problem?When we double click, we will navigate to currency selector page two times if the navigation time is long enough. Because of 2nd click, What changes do you think we should make in order to solve the problem?We can debounce this.navigateToCurrencySelectionPage = _.debounce(this.navigateToCurrencySelectionPage.bind(this), 300); What alternative solutions did you explore? (Optional)We can check if (!decodeURIComponent(activeRoute).includes('/new/currency/')) {
Navigation.navigate(ROUTES.getMoneyRequestCurrencyRoute(this.iouType, this.reportID, this.state.selectedCurrencyCode, activeRoute));
} |
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing the currency symbol twice will make the currency selection doesn't work. What is the root cause of that problem?When we navigate to currency selection, we pass App/src/pages/iou/steps/MoneyRequestAmountPage.js Lines 410 to 411 in 60f4817
When we select a currency, we will navigate back to the App/src/pages/iou/IOUCurrencySelection.js Line 92 in 60f4817
The currency will be updated if the App/src/pages/iou/steps/MoneyRequestAmountPage.js Lines 144 to 148 in 60f4817
When we quickly press the currency symbol multiple times, we will do the navigation action multiple times and the active route for the first and the rest action is different. Let's take request money as an example.
Notice that the App/src/pages/iou/IOUCurrencySelection.js Lines 89 to 90 in 60f4817
Let's say we fix the above issue by disabling the button press when navigating. What changes do you think we should make in order to solve the problem?We should prevent the user from clicking the currency symbol multiple times. In App/src/components/Pressable/PressableWithFeedback.js Lines 88 to 90 in 25f7ac1
Currently, currency symbols use However, this isn't enough. On some platforms, long-pressing a button will trigger the
So, even when we "disable" the button, the Pressable can still receive touch and "start the long press delay timer" and trigger the long press after the button is re-enabled. To fix this, we should fully disable the Pressable by disabling it through
This will set
With these changes, we don't need I also suggested splitting the PR into 2 PRs. The first PR is to move the |
Job added to Upwork: https://www.upwork.com/jobs/~01ac5f2b1e902a7171 |
Current assignee @maddylewis is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
assigned C+ to review existing proposals |
bumping @eVoloshchak to review existing proposals. lmk if you're overloaded and i can reach out to another C+ - thx! |
@ginsuma, thanks for the proposal! Debouncing navigate would technically resolve the issue, but I think that's more of a workaround. Let's resolve the root cause instead @bernhardoj, can we implement the same logic in |
That's what I thought too, that's why I wrote
in my proposal 😄 @priyeshshah11 @s77rt maybe can help answer it. |
even I don't know the actual reason why we just implemented it in |
ProposalPlease re-state the problem that we are trying to solve in this issue.Unable to change the currency after double-clicking on the current currency What is the root cause of that problem?The navigation to the Currency selection page is handled in the following code. App/src/pages/iou/steps/MoneyRequestAmountPage.js Lines 361 to 365 in 67bac9d
In normal cases when the currency is clicked, the
But when the current currency is double-clicked, it somehow adds
What changes do you think we should make in order to solve the problem?Add a condition to check if the const navigateToCurrencySelectionPage = () => {
// Remove query from the route
const activeRoute = Navigation.getActiveRoute().replace(/\?.*/, '')
if (!activeRoute.includes('/currency')) {
// Encode the route.
const backToRoute = encodeURIComponent(activeRoute);
Navigation.navigate(ROUTES.getMoneyRequestCurrencyRoute(iouType.current, reportID.current, selectedCurrencyCode, backToRoute));
}
}; What alternative solutions did you explore? (Optional)N/A |
@eVoloshchak |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@eVoloshchak - bump on this one - ty! |
@tranvantoan-qn, this is a workaround, let's prevent this function from being called twice in the first place @bernhardoj, I think we should implement this in the generic pressable, so it's universally available |
@eVoloshchak included it on the alternative solution |
@bernhardoj's updated proposal looks good to me
🎀👀🎀 C+ reviewed! |
@francoisl, @eVoloshchak, @chiragsalian, @maddylewis, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick! |
lol what is happening with this issue? am i good to start processing payments to: |
@maddylewis we are still working out on the 2nd PR. Waiting for @eVoloshchak |
@francoisl, @eVoloshchak, @chiragsalian, @maddylewis, @bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
how are we looking @bernhardoj? are we still waiting on the 2nd PR? #22497 (comment) |
Yes. Last week, @eVoloshchak started a discussion on Slack (c+ channel I guess?) about the PR solution. @eVoloshchak would you mind sharing the result of the discussion? |
@francoisl, @eVoloshchak, @chiragsalian, @maddylewis, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick! |
In our discussion, we didn't reach a definite answer to the question "Is this worth fixing?", but we did figure out that this behavior is not caused by our code and can be reproduced even in an empty project, so it's a default behavior
Given that
I think we should just close the second PR and not proceed with the fix further |
@chiragsalian any opinion? I think we can handle the 2nd problem on a separate issue here #26978. I have a new completely different solution ready for the 2nd problem, but I think we need to discuss it more on the new linked issue above |
Yeah i think discussing the 2nd problem in a separate issue makes sense to me. I like having an issue for a very specific usecase like this because if we don't want to solve it now and we close it that's fine. But if we ever want to tackle it in the future there is an existing issue we can open/refer to continue the discussion as needed. I think considering the first PR solving the main issue here is good enough for me. |
Okay great, I have closed the 2nd PR. We can address it on this new issue #26978. I think the next step is the checklist |
I'll fill out the BZ checklist today |
got it - waiting for @eVoloshchak to fill out the BZ checklist. this one has a lot of moving parts so i need a little guidance on how payments are looking for this one. let me know how this is looking:
|
Regression Test Proposal
Do we agree 👍 or 👎 |
Payments
|
everyone is paid |
@maddylewis There is a previous contract for this one, should it be closed now? |
$2,000 payment approved for @eVoloshchak based on summary above. |
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 currency should change to the selected one.
Actual Result:
The selected currency remains unchanged after double-clicking on the current currency.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.38-3
Reproducible in staging?: y
Reproducible in production?: y
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
DOUBLE-CLICKED-Currency-not-changed.MP4
QWVO2990.mp4
Expensify/Expensify Issue URL:
Issue reported by: @tranvantoan-qn
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688821290443479
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: