Skip to content

[HOLD for payment 2025-02-04] [$250] Wallet - In debug menu any toggle action applied with a delay #54767

Closed

Description

@vincdargento

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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.

  1. Go to Settings > Wallet
  2. Press key combination Cmd+D
  3. Turn any toggle (e.g. Force offline)

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:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021876724087999435775
  • Upwork Job ID: 1876724087999435775
  • Last Price Increase: 2025-01-14
  • Automatic offers:
    • linhvovan29546 | Contributor | 105726162
Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 2, 2025
  2. melvin-bot commented on Jan 2, 2025

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (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.

  3. linhvovan29546 commented on Jan 3, 2025

    @linhvovan29546
    Contributor

    Edited by proposal-police: This proposal was edited at 2025-01-03 03:07:12 UTC.

    Proposal

    Please 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

    <Section
    subtitle={translate('walletPage.addBankAccountToSendAndReceive')}
    title={translate('common.bankAccounts')}
    isCentralPane
    titleStyles={styles.accountSettingsSectionTitle}
    illustration={LottieAnimations.BankVault}

    And in debug menu we have Switch component, we handle onToggle callback inside
    InteractionManager.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 BankVault animation. I tested with other animations, and they worked well.(I'm not sure if the BankVault animation behaves differently from other animations)

    const handleSwitchPress = () => {
    InteractionManager.runAfterInteractions(() => {
    if (disabled) {
    disabledAction?.();
    return;
    }
    onToggle(!isOn);
    });
    };

    What changes do you think we should make in order to solve the problem?

    We can replace InteractionManager.runAfterInteractions to

            setTimeout(() => {
                if (disabled) {
                    disabledAction?.();
                    return;
                }
                onToggle(!isOn);
            }, 0);

    or

            requestAnimationFrame(() => {
                if (disabled) {
                    disabledAction?.();
                    return;
                }
                onToggle(!isOn);
            });

    Alternatively, we can remove InteractionManager.runAfterInteractions.
    I've tested the update and can no longer reproduce the issue #40650

    POC
    Before After
    Screen.Recording.2025-01-03.at.9.42.06.AM.mov
    Screen.Recording.2025-01-03.at.9.07.25.AM.mov

    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 component to specify whether InteractionManager.runAfterInteractions should be used

           <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]);
  4. andriivitiv commented on Jan 5, 2025

    @andriivitiv
    Contributor

    This is similar to #53208

  5. melvin-bot commented on Jan 6, 2025

    @melvin-bot

    @bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

  6. linhvovan29546 commented on Jan 6, 2025

    @linhvovan29546
    Contributor

    This is similar to #53208

    The root cause related to the Lottie animation prevents the InteractionManager.runAfterInteractions callback from executing, While that issue is marked as 'Hold for React Native 0.76,' I think it is not related to the RN version. 🤔

  7. bfitzexpensify commented on Jan 7, 2025

    @bfitzexpensify
    Contributor

    This isn't a customer flow, but not ideal for debugging.

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 7, 2025
  9. changed the title [-]Wallet - In debug menu any toggle action applied with a delay[/-] [+][$250] Wallet - In debug menu any toggle action applied with a delay[/+] on Jan 7, 2025
  10. melvin-bot commented on Jan 7, 2025

    @melvin-bot
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 7, 2025
  12. 35 remaining items

  13. changed the title [-][$250] Wallet - In debug menu any toggle action applied with a delay[/-] [+][HOLD for payment 2025-02-04] [$250] Wallet - In debug menu any toggle action applied with a delay[/+] on Jan 28, 2025
  14. melvin-bot commented on Jan 28, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jan 28, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 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 2025-02-04. 🎊

    For reference, here are some details about the assignees on this issue:

  16. melvin-bot commented on Jan 28, 2025

    @melvin-bot

    @rayane-djouah @bfitzexpensify @rayane-djouah The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  17. moved this from Bugs and Follow Up Issues to Hold for Payment in #expensify-bugson Jan 28, 2025
  18. rayane-d commented on Feb 3, 2025

    @rayane-d
    Contributor

    BugZero Checklist:

    • Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/40650/files#r1939526071

    • If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [@bfitzexpensify] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    
    #### Test:
    
    1. Go to Settings > Wallet
    2. Press key combination Cmd+D
    3. Turn any toggle (e.g. Force offline)
    4. Verify that toggle is switched immediately.
    
    

    Do we agree 👍 or 👎

  19. melvin-bot commented on Feb 3, 2025

    @melvin-bot

    📣 @rayane-d! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  20. rayane-d commented on Feb 4, 2025

    @rayane-d
    Contributor

    Requested in NewDot

  21. bfitzexpensify commented on Feb 4, 2025

    @bfitzexpensify
    Contributor

    Payment summary:

    $250 for @linhvovan29546 - paid via Upwork
    $250 for @rayane-d - to be paid via ND request

  22. moved this from Hold for Payment to Done in #expensify-bugson Feb 4, 2025
  23. garrettmknight commented on Feb 11, 2025

    @garrettmknight
    Contributor

    $250 approved for @rayane-d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions