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

Web - Automatically opens FAB menu on reload of room invite page #21225

Closed
1 of 6 tasks
kbecciv opened this issue Jun 21, 2023 · 5 comments
Closed
1 of 6 tasks

Web - Automatically opens FAB menu on reload of room invite page #21225

kbecciv opened this issue Jun 21, 2023 · 5 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jun 21, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Create a room
  2. Copy the url (from share code)
  3. Go to incognito browser
  4. Paste the link
  5. Reload and observe 2-3 times

Expected Result:

It should not open FAB menu

Actual Result:

Opens FAB menu on reload

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.30.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:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

bandicam.2023-06-14.20-14-08-310.mp4

Expensify/Expensify Issue URL:

Issue reported by: @chiragxarora

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686753816169919

View all open jobs on GitHub

@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Triggered auto assignment to @twisterdotcom (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@namhihi237
Copy link
Contributor

namhihi237 commented Jun 21, 2023

Proposal

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

It should not open FAB menu when open link room public

What is the root cause of that problem?

The problem here is that when opening the link room, it will run the function Message.show() with the function showCreateMenu as the number.

componentDidMount() {
const navigationState = this.props.navigation.getState();
const routes = lodashGet(navigationState, 'routes', []);
const currentRoute = routes[navigationState.index];
if (currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) {
return;
}
Welcome.show({routes, showCreateMenu: this.showCreateMenu});
}

and then the function showCreateMenu will be run here, I think this logic is for new users just first join. I tried with new user login and it will run here.

// If user is not already an admin of a free policy and we are not navigating them to their workspace or creating a new workspace via workspace/new then
// we will show the create menu.
if (!Policy.isAdminOfFreePolicy(allPolicies) && !isDisplayingWorkspaceRoute) {
showCreateMenu();
}

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

const topRoute = _.last(routes);

I think we need to check if the route has state.

if (!Policy.isAdminOfFreePolicy(allPolicies) && !isDisplayingWorkspaceRoute && !topRoute.state) {
  showCreateMenu();
}

Result:

Screen.Recording.2023-06-22.at.01.10.36.mov

What alternative solutions did you explore? (Optional)

We can replace it with the condition that the user is logged in or not, if logged in we mean the new user logged in for the first time and we will show it.

@alitoshmatov
Copy link
Contributor

Proposal

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

Web - Automatically opens FAB menu on reload of room invite page

What is the root cause of that problem?

We are opening FAB for anonymous users too.

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

We should not trigger Welcome.show if user is is anonymous

Welcome.show({routes, showCreateMenu: this.showCreateMenu});

We can add condition to check if user is logged in or not, by doing this, state.isAnonymousUser already exists in FAB component:

if (this.state.isAnonymousUser) {
            return;
        }

What alternative solutions did you explore? (Optional)

@twisterdotcom
Copy link
Contributor

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
Projects
None yet
Development

No branches or pull requests

4 participants