-
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
[$250] Wallet - In debug menu any toggle action applied with a delay #54767
Comments
Triggered auto assignment to @bfitzexpensify ( |
Edited by proposal-police: This proposal was edited at 2025-01-03 03:07:12 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Wallet - Toggle is not response. User has to close debug menu and go to another tad to see change applied. What is the root cause of that problem?In the wallet page, we have Lottie Animation here App/src/pages/settings/Wallet/WalletPage/WalletPage.tsx Lines 373 to 378 in 1cfcfa4
And in debug menu we have Switch component, we handle onToggle callback insideInteractionManager.runAfterInteractions come from this PR #40650 and it never called because the Lottie Animation in the Wallet page is running loop
Note: This issue only occurs when using the Lines 45 to 53 in 1cfcfa4
What changes do you think we should make in order to solve the problem?We can replace setTimeout(() => {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
}, 0); or requestAnimationFrame(() => {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
}); Alternatively, we can remove POC
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?No, it only UI What alternative solutions did you explore? (Optional)We can consider adding a new prop to the <Switch
...
shouldRunAfterInteractions={false}
/> const handleSwitchPress = () => {
if (shouldRunAfterInteractions) {
InteractionManager.runAfterInteractions(() => {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
});
} else {
if (disabled) {
disabledAction?.();
return;
}
onToggle(!isOn);
}
} We can consider pause Lottie Animation when debug menu is opened here const [isTestToolsModalOpen = false] = useOnyx(ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN);
const isRenderedRef = useRef(false)
const isFocused = useIsFocused();
const prevIsTestToolsModalOpen = usePrevious(isTestToolsModalOpen);
useEffect(() => {
if (!isRenderedRef.current && !isFocused) return;
if (isTestToolsModalOpen) {
setHasNavigatedAway(true);
} else {
if (prevIsTestToolsModalOpen && animationRef.current) {
setHasNavigatedAway(false);
animationRef.current.play();
}
}
}, [isTestToolsModalOpen, prevIsTestToolsModalOpen, isFocused, isRenderedRef.current]); |
This is similar to #53208 |
@bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
This isn't a customer flow, but not ideal for debugging. |
Job added to Upwork: https://www.upwork.com/jobs/~021876724087999435775 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rayane-djouah ( |
@rayane-djouah is there any update on my proposal? |
@linhvovan29546 are you still able to reproduce the bug on the latest main? |
Screen.Recording.2025-01-13.at.4.15.01.AM.movI'm not able to reproduce the bug. @linhvovan29546 is there anything I'm missing? |
@rayane-djouah I can still reproduce this issue on the main branch. Issue here the Lottie animation prevents runAfterInteractions (because the InteractionManager allows long-running work to be scheduled after any interactions/animations have completed). I think this happens on low-performance devices Screen.Recording.2025-01-13.at.11.55.31.AM.mov |
I'm able to reproduce with 4x CPU slowdown 👍 Screen.Recording.2025-01-13.at.12.55.24.PM.mov
I'm able to reproduce on all pages that use Lottie animation. |
Since we no longer navigate to the feature page when enabling it on the "More Features" page, the bug described in issue #39443 is no longer reproducible. This means we should be safe to remove
I feel that the alternative solutions proposed are overly engineered and may introduce unnecessary complexity. @linhvovan29546 I did notice some flickering with the switch button animation on pages that use Lottie animations. Could this be a conflict between Lottie animations and Screen.Recording.2025-01-13.at.1.16.33.PM.mov |
@rayane-djouah I don't believe this is a conflict issue. Instead, I think it’s related to CPU slowdown. I tested this by pausing the Lottie animation (as it consumes high CPU), and I observed the same flickering issue as you described with high CPU slowdown. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Issue was found while executing issue retest #54746
Version Number: v9.0.80-6
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: #54746
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: MacOS Catalina 10.15.7
App Component: Other
Action Performed:
Precondition: user is logged in desktop app.
Expected Result:
Toggle is switched immediately.
Actual Result:
Toggle is not response. User has to close debug menu and go to another tad to see change applied.
Workaround:
Unknown
Platforms:
Screenshots/Videos
bug.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @rayane-djouahThe text was updated successfully, but these errors were encountered: