Skip to content
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] mWeb - Selector - User lands on the same WS when double tapping on different one on selector #51402

Open
1 of 8 tasks
IuliiaHerets opened this issue Oct 24, 2024 · 9 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Oct 24, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.53-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5122323&group_by=cases:section_id&group_order=asc&group_id=296775
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Tap on Workspace selector on the top left corner.
  3. Change to any workspace on the list.
  4. Double tap on Expensify option.
  5. Verify that all the chats are displayed in LHN.
  6. Open Workspace selector again.
  7. Double tap on the next workspace to the one selected.
  8. Verify that the chats of the selected workspace are displayed.

Expected Result:

LHN should display the selected workspace chats when the user double taps over it in selector.

Actual Result:

User remains on the same workspace when trying to select "Expensify" option or next workspace on the selector list with double tapping.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6643981_1729740526844.Selector_WS.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021849976484014852041
  • Upwork Job ID: 1849976484014852041
  • Last Price Increase: 2024-10-26
Issue OwnerCurrent Issue Owner: @s77rt
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 24, 2024
Copy link

melvin-bot bot commented Oct 24, 2024

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

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@IuliiaHerets
Copy link
Author

@stephanieelliott FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@nyomanjyotisa
Copy link
Contributor

nyomanjyotisa commented Oct 24, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Selector - User lands on the same WS when double tapping on different one on selector

What is the root cause of that problem?

On double click, only Navigation.goBack() executed on the second click, and the Navigation.navigateWithSwitchPolicyID({policyID}) not executed since policyID !== activeWorkspaceID is true on second click

const selectPolicy = useCallback(
(option?: WorkspaceListItem) => {
if (!option) {
return;
}
const {policyID} = option;
setActiveWorkspaceID(policyID);
Navigation.goBack();
if (policyID !== activeWorkspaceID) {
Navigation.navigateWithSwitchPolicyID({policyID});
}
},
[activeWorkspaceID, setActiveWorkspaceID],
);

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

Implement debouncing to prevent double click

    const selectPolicy = useCallback(
        debounce((option?: WorkspaceListItem) => {
            console.log("set policy")

            if (!option) {
                return;
            }

            const {policyID} = option;

            setActiveWorkspaceID(policyID);
            Navigation.goBack();
            if (policyID !== activeWorkspaceID) {
                Navigation.navigateWithSwitchPolicyID({policyID});
            }
        }, 300),
        [activeWorkspaceID, setActiveWorkspaceID],
    );

What alternative solutions did you explore? (Optional)

@Krishna2323
Copy link
Contributor

Proposal


Please re-state the problem that we are trying to solve in this issue.

mWeb - Selector - User lands on the same WS when double tapping on different one on selector

What is the root cause of that problem?

  • Double navigation is happening because the Navigation.goBack(); & Navigation.navigateWithSwitchPolicyID({policyID}); is called twice when double clicking.
    const selectPolicy = useCallback(
    (option?: WorkspaceListItem) => {
    if (!option) {
    return;
    }
    const {policyID} = option;
    setActiveWorkspaceID(policyID);
    Navigation.goBack();
    if (policyID !== activeWorkspaceID) {
    Navigation.navigateWithSwitchPolicyID({policyID});
    }
    },
    [activeWorkspaceID, setActiveWorkspaceID],
    );

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


  • We can use useIsFocused hook to check if the screen is focused or not and if the screen is not focused we will return early from selectPolicy .
    const isFocused = useIsFocused();

    const selectPolicy = useCallback(
        (option?: WorkspaceListItem) => {
            if (!option || !isFocused) {
                return;
            }

            const {policyID} = option;

            setActiveWorkspaceID(policyID);
            Navigation.goBack();
            if (policyID !== activeWorkspaceID) {
                Navigation.navigateWithSwitchPolicyID({policyID});
            }
        },
        [activeWorkspaceID, setActiveWorkspaceID, isFocused],

What alternative solutions did you explore? (Optional)

Result

@stephanieelliott stephanieelliott added the External Added to denote the issue can be worked on by a contributor label Oct 26, 2024
@melvin-bot melvin-bot bot changed the title mWeb - Selector - User lands on the same WS when double tapping on different one on selector [$250] mWeb - Selector - User lands on the same WS when double tapping on different one on selector Oct 26, 2024
Copy link

melvin-bot bot commented Oct 26, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021849976484014852041

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 26, 2024
Copy link

melvin-bot bot commented Oct 26, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External)

@s77rt
Copy link
Contributor

s77rt commented Oct 26, 2024

@nyomanjyotisa Thanks for the proposal. Do you know why this happens on mWeb Chrome only?

@s77rt
Copy link
Contributor

s77rt commented Oct 26, 2024

@Krishna2323 Thanks for the proposal. Same question ^ any idea why this does not happen on other platforms?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants