Skip to content

[HOLD for payment 2024-03-07] [$500] Unlink - A non-stopping spinner is displayed when unlinking secondary contact method #36618

Closed

Description

@lanitochka17

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.42-1
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): natnael.expensify+3@gmail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Add a secondary contact method
  2. Don't verify it
  3. Sign out > enter the secondary contact method > click 'Continue' > click on 'Unlink' button
  4. Click on 'the validation link here' from email

Expected Result:

Sign in page should be displayed and a 'secondary login successfully unlinked' message should be displayed

Actual Result:

A non-stoping spinner displayed

Workaround:

Unknown

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

Bug6381026_1708021785560.Screen_Recording_2024-02-15_at_2.47.09_in_the_afternoon.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0167c0a20638f140b9
  • Upwork Job ID: 1758198209202040832
  • Last Price Increase: 2024-02-15
  • Automatic offers:
    • bernhardoj | Contributor | 0

Activity

  1. added
    External
    Daily
    Bug
    on Feb 15, 2024
  2. changed the title [-]Unlink - A non-stopping spinner is displayed when unlinking secondary contact method[/-] [+][$500] Unlink - A non-stopping spinner is displayed when unlinking secondary contact method[/+] on Feb 15, 2024
  3. melvin-bot commented on Feb 15, 2024

    @melvin-bot
  4. added
    Help Wanted
    on Feb 15, 2024
  5. melvin-bot commented on Feb 15, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 15, 2024

    @melvin-bot

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

  7. lanitochka17 commented on Feb 15, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #wave9
    CC @MitchExpensify

  8. bernhardoj commented on Feb 16, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Unlink page shows loading indicator indefinitely.

    What is the root cause of that problem?

    There are 2 issues.

    First, when we navigate to ROUTES.HOME, it will go to the bottom tab navigator screen. The bottom tab navigator for the public screen is the sign-in page.

    <RootStack.Screen
    name={NAVIGATORS.BOTTOM_TAB_NAVIGATOR}
    options={defaultScreenOptions}
    component={SignInPage}
    />

    We have a logic here to check if the bottom tab action doesn't exist, and then we return early.

    } else if (action.payload.name === NAVIGATORS.BOTTOM_TAB_NAVIGATOR) {
    // If path contains a policyID, we should invoke the navigate function
    const shouldNavigate = !!extractedPolicyID;
    const actionForBottomTabNavigator = getActionForBottomTabNavigator(action, rootState, policyID, shouldNavigate);
    if (!actionForBottomTabNavigator) {
    return;
    }

    The action will be undefined if the bottom tab screen we are targeting is the same topmost bottom tab screen, in this case, the sign-in page

    // Check if the current bottom tab is the same as the one we want to navigate to. If it is, we don't need to do anything.
    const bottomTabCurrentTab = getTopmostBottomTabRoute(state);
    const bottomTabParams = bottomTabCurrentTab?.params as Record<string, string | undefined>;
    // Verify if the policyID is different than the one we are currently on. If it is, we need to navigate to the new policyID.
    const isNewPolicy = bottomTabParams?.policyID !== payloadParams?.policyID;
    if (bottomTabCurrentTab?.name === screen && !shouldNavigate && !isNewPolicy) {
    return;
    }

    The second issue is, that the bottom tab navigator is a nested navigator.

    [NAVIGATORS.BOTTOM_TAB_NAVIGATOR]: {
    path: ROUTES.ROOT,
    initialRouteName: SCREENS.HOME,
    screens: {
    [SCREENS.HOME]: ROUTES.HOME,

    So, navigating to ROUTES.HOME will resolve to a navigation action that looks like below. Notice that it has a screen params of HOME.
    image

    But the public screen structure for the bottom tab navigator isn't the same as the auth screen structure (not a nested navigator as shown in the first permalink above), so the navigation will never succeed.

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

    The first issue has the same root cause as #36145 and I posted a solution there too and one of the solutions is to replace Navigation.navigate with Navigation.goBack. If we use this solution, then the 2nd issue won't happen.

    What alternative solutions did you explore? (Optional)

    If we want to keep Navigation.navigate(ROUTES.HOME), then we need to use the alternative solution from my proposal there. Then, we need to fix the public screen bottom tab navigator structure to:

    const SignInPageStack = createStackNavigator();
    
    const SignInPageNavigator = () => {
        return (
            <SignInPageStack.Navigator>
                <SignInPageStack.Screen name={SCREENS.HOME} component={SignInPage} />
            </SignInPageStack.Navigator>
        )
    }
    
    <RootStack.Screen
        name={NAVIGATORS.BOTTOM_TAB_NAVIGATOR}
        options={defaultScreenOptions}
        component={SignInPageNavigator}
    />
    
  9. MitchExpensify commented on Feb 16, 2024

    @MitchExpensify
    Contributor

    I don't think this is wave 9 because it is not a bug experienced on a mainline onboarding flow

  10. rushatgabhane commented on Feb 17, 2024

    @rushatgabhane
    Member

    🎀👀🎀
    @bernhardoj's proposal makes sense to me #36618 (comment)

  11. 22 remaining items

  12. MitchExpensify commented on Mar 2, 2024

    @MitchExpensify
    Contributor

    Reminder set to pay on the 7th

  13. JmillsExpensify commented on Mar 4, 2024

    @JmillsExpensify
    Contributor

    Thank you! Don't forget the payment summary as well, when we get there.

  14. MitchExpensify commented on Mar 7, 2024

    @MitchExpensify
    Contributor

    Payment summary:

    C+: $500 - @rushatgabhane NewDot
    C: $500 - @bernhardoj

  15. isabelastisser commented on Mar 7, 2024

    @isabelastisser
    Contributor

    Payment processed in Upwork for @bernhardoj - $500.

  16. isabelastisser commented on Mar 7, 2024

    @isabelastisser
    Contributor

    @rushatgabhane, please complete the checklist above. Thanks!

  17. added
    Daily
    and removed
    Weekly
    on Mar 7, 2024
  18. isabelastisser commented on Mar 10, 2024

    @isabelastisser
    Contributor

    @rushatgabhane to complete the checklist. Thanks!

    #36618 (comment)

  19. isabelastisser commented on Mar 11, 2024

    @isabelastisser
    Contributor

    @rushatgabhane, please provide an update. Thanks!

  20. isabelastisser commented on Mar 11, 2024

    @isabelastisser
    Contributor

    I just DM'd @rushatgabhane.

  21. rushatgabhane commented on Mar 11, 2024

    @rushatgabhane
    Member
    1. The PR that introduced the bug has been identified. Link to the PR: Fix App show error when open unlink in Desktop App  #23738

    2. 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/23738/files#r1520478915

    3. 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: N.A.

    4. Determine if we should create a regression test for this bug. - No

    5. 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 - N.A.

  22. rushatgabhane commented on Mar 11, 2024

    @rushatgabhane
    Member

    Sorry it took so long
    @isabelastisser checklist done

  23. JmillsExpensify commented on Mar 11, 2024

    @JmillsExpensify
    Contributor

    $500 approved based on this summary and completed checklist.

  24. isabelastisser commented on Mar 14, 2024

    @isabelastisser
    Contributor

    All set!

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions