-
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
[$2000] Toggle switch fails to toggle back when tapped again on preferences page #25880
Comments
Triggered auto assignment to @strepanier03 ( |
Bug0 Triage Checklist (Main S/O)
|
We don't have this Samsung phone type in Browserstack so I'm stuck on repro'ing. I raised this for discussion internally on a plan to move forward. |
@strepanier03 It does not have to be the same phone just try it on android 12 |
@strepanier03 it is also reproducible on other android versions |
Aaah, yeah I just realized I'm updated to Android 13 and so are our browserstack models. I am clarifying best practice and will move it forward then. |
Ongoing discussion, I'll update as soon as I have consensus. |
Since 68% of Android users are on Android 12 or lower, we want to fix this. Moving forward! |
Job added to Upwork: https://www.upwork.com/jobs/~01d30a31388a44c81c |
Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Waiting for proposals Melvin. |
@strepanier03, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
ProposalPlease re-state the problem that we are trying to solve in this issue.The switches on preferences page are only working once What is the root cause of that problem?In Switch component we are using PressableWithFeedback, in the onPress method of PressableWithFeedback here:
We use the singleExecution hook which goal is to guarantee that we don't run the method twice if we press twice before the first method run hasn't finished. In this hook here: App/src/hooks/useSingleExecution.js Lines 26 to 34 in d447b95
We set isExecuting to false in the callback of InteractionManager.runAfterInteractions The root cause is that in our case runAfterInteractions never fire the callback so isExecuting stays at true and onPress method is never called again. The reason runAfterInteractions doesn't fire is because there is a lottie animation on the page and there is an issue here airbnb/lottie-web#3002 where the lottie animation prevents requestIdleCallback from firing, requestIdleCallback is used in runAfterInteractions for react-native-web here: https://github.com/necolas/react-native-web/blob/a3ea2a0a4fd346a1b32e6cef527878c8e433eef8/packages/react-native-web/src/exports/InteractionManager/index.js#L100-L108 What changes do you think we should make in order to solve the problem?One way is to fix Lottie so that requestIdleCallback is called, requestIdleCallback is not called because the animation constantly call requestAnimationFrame here: https://github.com/airbnb/lottie-web/blob/63a39aeb27b8c13726ce9fcf850d9351b14be3e6/player/js/animation/AnimationManager.js#L108 We could wait before requesting the frame for example like this:
I think the best way would be to do this waiting only once in a while (for example every 100 times the method is called ) and only if the animation is a loop. It works well. What alternative solutions did you explore? (Optional)We could use setDeadline of InteractionManager because using it allow to avoid using requestIdleCallback The recommended way to use requestIdleCallback is to pass a parameter timeout to be sure that the callback will be called at some point, currently in react-native-web they don't use the timeout parameter |
It's hard to have a specific solution has long as we don't know in which cases runAfterInteractions was used, I will try to find the reason. PS: I am almost sure that I was able to reproduce on windows chrome at some point during my tests but now I can't reproduce |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@ShogunFire, can we move forward now? |
Friendly bump @ShogunFire, thanks! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Still waiting for proposals, all good melvin. |
Issue not reproducible during KI retests. (third week) |
@strepanier03, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick! |
I'll test this again today or tomorrow. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@strepanier03, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
It seems to work on Andriod 10. @strepanier03 Could you please retest this again? |
@strepanier03, @thesahindia 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Was out of the office. Working on this now. |
Here's what I found:
@Tony-MK - Can you add a screencast of your repro and a bit more about your testing device so I can try to emulate your testing parameters? |
@strepanier03, Since you couldn't reproduce the bug on Android 12, could this other problem only apply to me? Listed devices from left to right respectively:
StagingProduction |
Issue not reproducible during KI retests. (Fourth week) |
@Tony-MK - I guess it could be specific to you, but I'm not 100% sure. I'll do another round of testing and if I still can't repro we can close this out until it becomes relevant again, at which point we can reopen. |
Testing resultsAndroid Chrome
Okay, so I think at this point we close. I've tested on various Android versions and can't reproduce this any longer. |
Thanks a lot for the confirmation. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Toggle switch should switch to ON/OFF when it is tapped again
Actual Result:
The toggle switch only works once and does not respond to subsequent taps
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: needs reproduction
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
Notes/Photos/Videos: Any additional supporting documentation
20230824_214923.mp4
Expensify/Expensify Issue URL:
Issue reported by:@jo-ui
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692040308927449
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: