Skip to content

[HOLD for payment 2024-03-18] [$500] Public room - Sign-in modal is hidden behind welcome modal after selecting an option #35131

Closed

Description

@kavimuru

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: 1.4.31-2
Reproducible in staging?: y
Reproducible in production?: new feature
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
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

Action Performed:

  1. Log out if logged in.

  2. Navigate to public room https://staging.new.expensify.com/r/2376199970894587

  3. Select any option in the welcome message modal.

Expected Result:

Welcome modal will dismiss and sign-in modal will appear after selecting an option.

Actual Result:

The link changes to sign-in URL, but the welcome modal does not dismiss and the sign-in modal is hidden behind it.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6354272_1706163569570.20240125_113158.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bdb196958ade050b
  • Upwork Job ID: 1752411868444123136
  • Last Price Increase: 2024-02-27
  • Automatic offers:
    • fedirjh | Reviewer | 0
    • dukenv0307 | Contributor | 0
Issue OwnerCurrent Issue Owner: @kevinksullivan

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Jan 25, 2024
  2. melvin-bot commented on Jan 25, 2024

    @melvin-bot

    Triggered auto assignment to @marcaaron (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Jan 25, 2024

    @melvin-bot

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

  4. github-actions commented on Jan 25, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. aimane-chnaif commented on Jan 25, 2024

    @aimane-chnaif
    Contributor

    Missing test case from #32154

  6. aimane-chnaif commented on Jan 25, 2024

    @aimane-chnaif
    Contributor

    What's the expected behavior after opening public link while signed out?

    • show FAB as usual
    • show welcome modal and selecting any option dismiss modal and show sign-in modal

    cc: @stitesExpensify

  7. dummy-1111 commented on Jan 25, 2024

    @dummy-1111
    Contributor

    Proposal

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

    Sign-in modal is hidden behind welcome modal after selecting an option in public room

    What is the root cause of that problem?

    We have recently introduced full screen engagement modal named PurposeForUsingExpensifyModal

    We pass onPress handler to the MenuItem here

    onPress: () => completeModalAndClose(messageCopy[choice], choice),

    When selecting an option, we redirect to the sign-in modal if the user is not signed in

    onPress={shouldCheckActionAllowedOnPress ? Session.checkIfActionIsAllowed(onPressAction, isAnonymousAction) : onPressAction}

    function checkIfActionIsAllowed<TCallback extends (...args: any[]) => any>(callback: TCallback, isAnonymousAction = false): TCallback | (() => void) {
    if (isAnonymousUser() && !isAnonymousAction) {
    return () => signOutAndRedirectToSignIn();
    }
    return callback;
    }

    So menu item's onPress handler isn't executed at all.
    This is the root cause

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

    We can listen navigation state and hide the engagement modal if needed
    We show this modal on mount here

    useEffect(() => {
    const navigationState = navigation.getState();
    const routes = navigationState.routes;
    const currentRoute = routes[navigationState.index];
    if (currentRoute && NAVIGATORS.CENTRAL_PANE_NAVIGATOR !== currentRoute.name && currentRoute.name !== SCREENS.HOME) {
    return;
    }
    Welcome.show(routes, () => setIsModalOpen(true));
    // eslint-disable-next-line react-hooks/exhaustive-deps
    }, []);

    We can add navigation listener here

        useEffect(() => {
            ~  ~  ~
            Welcome.show(routes, () => setIsModalOpen(true));
            return navigation.addListener('state', (event) => {
                const state = event.data.state;
                const route = state.routes[state.index];
                if (route.name === currentRoute.name) {
                    return;
                }
                setIsModalOpen(false);
            });
            // eslint-disable-next-line react-hooks/exhaustive-deps
        }, []);
    

    We compare the route's name to determine if we need to hide the modal in the above solution. We can use more optimized or suitable comparison

    The solution works as expected

    Result
    35131.mp4

    What alternative solutions did you explore? (Optional)

  8. thienlnam commented on Jan 25, 2024

    @thienlnam
    Contributor

    Interesting - will wait to let @stitesExpensify chime in. We'll definitely want to fix this soon, though I don't think this needs to block deploy. This relies on engaging with us from a public room and if you dismiss the screen you'll see the sign in screen

  9. 98 remaining items

  10. melvin-bot commented on Mar 11, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
    • [@fedirjh] 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:
    • [@fedirjh] A discussion in #expensify-bugs 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:
    • [@fedirjh] Determine if we should create a regression test for this bug.
    • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  11. added
    Daily
    and removed
    Weekly
    on Mar 17, 2024
  12. melvin-bot commented on Mar 20, 2024

    @melvin-bot

    @kevinksullivan, @marcaaron, @fedirjh, @dukenv0307 Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  13. fedirjh commented on Mar 25, 2024

    @fedirjh
    Contributor

    BugZero Checklist:

  14. dukenv0307 commented on Apr 1, 2024

    @dukenv0307
    Contributor

    @kevinksullivan The PR was deployed to production 3 weeks ago, could we proceed with payments here?

    Thank you!

  15. melvin-bot commented on Apr 8, 2024

    @melvin-bot

    @kevinksullivan, @marcaaron, @fedirjh, @dukenv0307 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  16. marcaaron commented on Apr 10, 2024

    @marcaaron
    Contributor

    Bumping this one.

  17. melvin-bot commented on Apr 10, 2024

    @melvin-bot

    @kevinksullivan, @marcaaron, @fedirjh, @dukenv0307 Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

  18. kevinksullivan commented on Apr 11, 2024

    @kevinksullivan
    Contributor

    Sorry for the delay here, all set.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions