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

[HOLD for payment 2024-02-14] [$500] Login - Blank screen and infinite spinner when logging in using magic link #35745

Closed
2 of 6 tasks
lanitochka17 opened this issue Feb 3, 2024 · 35 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 3, 2024

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.36
Reproducible in staging?: Y
Reproducible in production?: N
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. Open the app
  2. Enter the email and tap "Continue"
  3. Find the email and use the magic link to log in (change to staging if needed)

Expected Result:

User is logged in and lands on LHN

Actual Result:

The blank screen and the infinite 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

Bug6365447_1706916982856.video_2024-02-02_18-34-20.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b3cfffaf993f802b
  • Upwork Job ID: 1754481620046606336
  • Last Price Increase: 2024-02-05
  • Automatic offers:
    • situchan | Contributor | 28142697
    • aswin-s | Contributor | 28142698
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Feb 3, 2024
Copy link
Contributor

github-actions bot commented Feb 3, 2024

👋 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.

Copy link

melvin-bot bot commented Feb 3, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp
CC @quinthar

@Gonals
Copy link
Contributor

Gonals commented Feb 5, 2024

I have not been able to reproduce this. Is it only happening on staging?

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Feb 5, 2024
@melvin-bot melvin-bot bot changed the title Login - Blank screen and infinite spinner when logging in using magic code [$500] Login - Blank screen and infinite spinner when logging in using magic code Feb 5, 2024
Copy link

melvin-bot bot commented Feb 5, 2024

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

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

melvin-bot bot commented Feb 5, 2024

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

@mountiny mountiny changed the title [$500] Login - Blank screen and infinite spinner when logging in using magic code [$500] Login - Blank screen and infinite spinner when logging in using magic link Feb 5, 2024
@mountiny
Copy link
Contributor

mountiny commented Feb 5, 2024

@Gonals You need to use the link from the email, have you tried that. I was able to reproduce, this is a real blocker.

@mountiny
Copy link
Contributor

mountiny commented Feb 5, 2024

And given we use the last visited path on native now, when user gets to the loading page, kills the app and opens it again, they are stuck on the infinite spinner and they have to uninstall the app to fix it

@aswin-s
Copy link
Contributor

aswin-s commented Feb 5, 2024

Proposal

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

Infinite spinner when logging in using magic link

What is the root cause of that problem?

In ValidateLoginPage a useEffect is used to authenticateUser and signIn.

useEffect(() => {
if (session?.authToken) {
// If already signed in, do not show the validate code if not on web,
// because we don't want to block the user with the interstitial page.
Navigation.goBack();
} else {
Session.signInWithValidateCodeAndNavigate(Number(accountID), validateCode);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

When sign-in using deep link Navigation.isNavigationReady() return in false when invoked the first time. This results in non action.

function goBack(fallbackRoute?: Route, shouldEnforceFallback = false, shouldPopToTop = false) {
if (!canNavigate('goBack')) {
return;
}

function canNavigate(methodName: string, params: Record<string, unknown> = {}): boolean {
if (navigationRef.isReady()) {
return true;
}
Log.hmmm(`[Navigation] ${methodName} failed because navigation ref was not yet ready`, params);
return false;
}

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

We should wait till Navigation.isNavigationReady() is ready before invoking the effect.

    const [isNavReady, setIsNavReady] = useState(false)
    useEffect(() => {
        if (!isNavReady) { return }
        if (session?.authToken) {
            // If already signed in, do not show the validate code if not on web,
            // because we don't want to block the user with the interstitial page.
            Navigation.goBack();
        } else {
            Session.signInWithValidateCodeAndNavigate(Number(accountID), validateCode);
        }
        // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [isNavReady]);

   
    useEffect(() => {
        // Wait till navigation becomes available
        Navigation.isNavigationReady().then(() => {
            setIsNavReady(true)
        })
    }, [])

Result

fix-login_out.mp4

What alternative solutions did you explore? (Optional)

None

@Gonals
Copy link
Contributor

Gonals commented Feb 5, 2024

We should wait till Navigation.isNavigationReady() is ready before invoking the effect.

Yep. I was able to reproduce this time

@mountiny
Copy link
Contributor

mountiny commented Feb 5, 2024

@aswin-s Can you also test if this fixed #35782

Copy link

melvin-bot bot commented Feb 5, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@Gonals
Copy link
Contributor

Gonals commented Feb 5, 2024

@aswin-s, the proposal looks good! I'll assign you so we can get it fixed ASAP! Could you check the other issue @mountiny mentioned here?

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 5, 2024
Copy link

melvin-bot bot commented Feb 5, 2024

❌ There was an error making the offer to @ntdiary for the Reviewer role. The BZ member will need to manually hire the contributor.

Copy link

melvin-bot bot commented Feb 5, 2024

❌ There was an error making the offer to @aswin-s for the Contributor role. The BZ member will need to manually hire the contributor.

@mountiny mountiny added the Bug Something is broken. Auto assigns a BugZero manager. label Feb 5, 2024
@mountiny
Copy link
Contributor

mountiny commented Feb 5, 2024

Feel free to make drafts first in these scenarios so C+ can jump in sooner than later.

@aswin-s
Copy link
Contributor

aswin-s commented Feb 5, 2024

Draft PR here

@aswin-s
Copy link
Contributor

aswin-s commented Feb 5, 2024

@situchan @aswin-s please test on the PR if this was fixed too #35782, thank you!

@mountiny

Nope. This one looks like a different issue. However it affects testing of this issue on desktop environment.

desktop_out.mp4

@situchan
Copy link
Contributor

situchan commented Feb 5, 2024

yup different issue.
While #35745 is android/iOS bug, #35782 is web bug (wrongly tagged platform)

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Feb 5, 2024
@marcaaron marcaaron assigned marcaaron and unassigned Gonals Feb 5, 2024
@marcaaron
Copy link
Contributor

Testing well on iOS staging. Gonna remove the blocker here. Thanks for the quick solutions 🙇

@marcaaron marcaaron removed the DeployBlockerCash This issue or pull request should block deployment label Feb 5, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 7, 2024
@melvin-bot melvin-bot bot changed the title [$500] Login - Blank screen and infinite spinner when logging in using magic link [HOLD for payment 2024-02-14] [$500] Login - Blank screen and infinite spinner when logging in using magic link Feb 7, 2024
Copy link

melvin-bot bot commented Feb 7, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 7, 2024
Copy link

melvin-bot bot commented Feb 7, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.37-7 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 2024-02-14. 🎊

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

Copy link

melvin-bot bot commented Feb 7, 2024

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:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] 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:
  • [@situchan] 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:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] 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.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 13, 2024
@johncschuster
Copy link
Contributor

Payment has been issued! 🎉

@situchan, can you complete the BZ Checklist above? Thank you!

@situchan
Copy link
Contributor

I think this regression came from ideal nav.
As this was caught in staging by QA team, we don't need another regression test.

@melvin-bot melvin-bot bot added the Overdue label Feb 16, 2024
@johncschuster
Copy link
Contributor

Sounds great! Thanks for confirming that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants