Repository navigation
[HOLD for payment 2025-01-18] [HOLD for payment 2025-01-17] [$250] A blank white screen appears when a new user clicks on the workspace invite email link. #54174
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Dec 15, 2024 Triggered auto assignment to @abekkala (
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.Proposal
Please re-state the problem that we are trying to solve in this issue.
A blank screen shown when using the workspace invite email link.
What is the root cause of that problem?
There are 2 problems here. First, the magic code from the magic link is wrong. The format of a magic code should be a number, but on the OP screenshot, it's a character combination that can only be solved on the BE.
The second issue is, that since the magic code is invalid, we return here early and don't make any request to the BE.
App/src/pages/ValidateLoginPage/index.website.tsx
Lines 52 to 57 in 31adaa8
if (!ValidationUtils.isValidValidateCode(validateCode)) { return; } // The user has initiated the sign in process on the same browser, in another tab. Session.signInWithValidateCode(Number(accountID), validateCode); So, the state is always NOT_STARTED. A not found page is supposed to show inside
ValidateCodeModalif it's an invalid code, but since we only show it if there is noexitTo, then it's never shown because the link containsexitTo.
App/src/pages/ValidateLoginPage/index.website.tsx
Lines 86 to 91 in 31adaa8
{(!autoAuthState ? !shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.NOT_STARTED) && !exitTo && ( <ValidateCodeModal accountID={Number(accountID)} code={validateCode} /> )} What changes do you think we should make in order to solve the problem?
Why do we only show the
ValidateCodeModalcomponent if there is noexitTo? It's to solve this issue based on this comment. The issue is that the "here is your magic code" is shown briefly before navigating to theexitTo. This happens when the user is already signed in.If the user is already signed in, then there won't be a magic code sign in request,
App/src/pages/ValidateLoginPage/index.website.tsx
Lines 33 to 50 in 31adaa8
const shouldStartSignInWithValidateCode = !isUserClickedSignIn && !isSignedIn && (!!login || !!exitTo); useEffect(() => { if (isUserClickedSignIn) { // The user clicked the option to sign in the current tab Navigation.isNavigationReady().then(() => { Navigation.goBack(); }); return; } Session.initAutoAuthState(autoAuthStateWithDefault); if (!shouldStartSignInWithValidateCode) { if (exitTo) { Session.handleExitToNavigation(exitTo); } return; } so
shouldStartSignInWithValidateCodeis false and auto auth state is NOT_STARTED.
App/src/pages/ValidateLoginPage/index.website.tsx
Lines 86 to 92 in 31adaa8
{(!autoAuthState ? !shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.NOT_STARTED) && !exitTo && ( <ValidateCodeModal accountID={Number(accountID)} code={validateCode} /> )} {(!autoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN) && <FullScreenLoadingIndicator />} This works fine when the user is logged in, but not when the user is logged out, because
exitTois only executed after the user is logged in (handled byhandleExitToNavigation).To solve this, we can improve the condition to prevent the "here is your magic code" to show if there is an
exitToand only if the user is logged in.const isNavigatingToExitTo = isSignedIn && exitTo; {(!autoAuthState ? !shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.NOT_STARTED) && !isNavigatingToExitTo && (What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
I think we can test 2 cases, 1 when the user is logged in and there is an
exitTo, theValidateCodeModalshouldn't be rendered briefly. The 2nd case is this issue, where the user is logged out and there is anexitTowith an invalid magic code, theValidateCodeModalshould be rendered showing the not found page.- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Dec 18, 2024 - changed the title
[-]A blank white screen appears when a new user clicks on the workspace invite email link.[/-][+][$250] A blank white screen appears when a new user clicks on the workspace invite email link.[/+]on Dec 18, 2024 Job added to Upwork: https://www.upwork.com/jobs/~021869401988531631098
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Dec 18, 2024 Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (
External)@rushatgabhane can you review the proposal above? Thanks!
43 remaining items
@abekkala, @blimpich, @rushatgabhane, @bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
bumped @rushatgabhane in slack
@rushatgabhane please complete the checklist
Bumped @rushatgabhane in Slack once more
BugZero Checklist:
- [Contributor] Classify the bug:
Bug classification
Source of bug:
- 1a. Result of the original design (eg. a case wasn't considered)
- 1b. Mistake during implementation
- 1c. Backend bug
- 1z. Other:
Where bug was reported:
- 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
- 2b. Reported on staging (eg. found during regression or PR testing)
- 2d. Reported on a PR
- 2z. Other:
Who reported the bug:
- 3a. Expensify user
- 3b. Expensify employee
- 3c. Contributor
- 3d. QA
- 3z. Other:
-
[Contributor] 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/53756/files#r1938601404
-
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: Not critical
-
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
-
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
- Open a magic link with an invalid magic code and exitTo param (e.g., staging.new.expensify.com/v/1/123?exitTo=/concierge)
- For web/mWeb, verify a not found view is shown instead of blank screen
- For android/iOS, verify the login screen is shown with an error message
Do we agree 👍 or 👎
@abekkala, @blimpich, @rushatgabhane, @bernhardoj Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
$250 approved for @rushatgabhane
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
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: 9.0.76-6
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @quinthar
Slack conversation (hyperlinked to channel name): convert
Action Performed:
Expected Result:
The invite link should direct the user to the workspace setup or login page, allowing them to join the workspace.
Actual Result:
White blank screen displayed
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.849.mp4
Screen.Recording.2024-12-15.at.1.20.24.PM.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @abekkala