Open vincdargento opened 7 hours ago
Triggered auto assignment to @OfstadC (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Edited by proposal-police: This proposal was edited at 2024-12-04 18:44:16 UTC.
Troubleshoot - Double clicking/tapping outside of troubleshoot modal reopens the modal
We are already throttling the function here to avoid repeated calls in the timeout period
https://github.com/Expensify/App/blob/146204878d1b9d4358d91e9a0a81169a7819d96f/src/libs/actions/TestTool.ts#L28
but the problem is we throttled and defined the function inside the toggleTestToolsModal
function so it is being instantiated on every call so the throttling not working
We need to do the throttling outside the function
const toggle = () => {
const toggleIsTestToolsModalOpen = () => {
Onyx.set(ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN, !isTestToolsModalOpen);
};
if (!isTestToolsModalOpen) {
Modal.close(toggleIsTestToolsModalOpen);
return;
}
toggleIsTestToolsModalOpen();
};
const throttledToggle = throttle(toggle, CONST.TIMING.TEST_TOOLS_MODAL_THROTTLE_TIME, {leading: true, trailing: false});
/**
* Toggle the test tools modal open or closed.
* Throttle the toggle to make the modal stay open if you accidentally tap an extra time, which is easy to do.
*/
function toggleTestToolsModal() {
throttledToggle();
}
We can call toggleTestToolsModal
twice and assert our mock to toggle
function toHaveBeenCalledTimes
once. 👍
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.71-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): nathanmulugetatesting+2337@gmail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The modal closes
Actual Result:
The modal closes and reopens again
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/54a4e442-9c04-473b-a4d7-10fb22ba3cf7
View all open jobs on GitHub