Skip to content

Fix /transition route for already signed in users#7509

Merged
marcaaron merged 2 commits into
mainfrom
marcaaron-fixOldToNewDotTransitionForSignedInUser
Feb 4, 2022
Merged

Fix /transition route for already signed in users#7509
marcaaron merged 2 commits into
mainfrom
marcaaron-fixOldToNewDotTransitionForSignedInUser

Conversation

@marcaaron

@marcaaron marcaaron commented Feb 1, 2022

Copy link
Copy Markdown
Contributor

Details

There are a few ways a user can transition from OldDot to NewDot none of them work particularly well when the user is already signed into an existing account that is different from the one they are logging in as.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/193842
$ https://github.com/Expensify/Expensify/issues/193843

Tests / QA Steps

Test new account that does not have a policy yet

  1. Open an incognito window and go to expensify.com
  2. Sign in to expensify.com as a brand new user (User A)
  3. Click "Get Started" on WelcomeFree
  4. Verify and note that User A is now logged into NewDot
  5. Navigate back to expensify.com and sign out
  6. Sign in to expensify.com as a brand new user (User B)
  7. Click "Get Started" on WelcomeFree
  8. Verify User A is logged out, User B is logged in, only one workspace is created, and User B is brought to the Workspace settings view

Test creating a new free policy for account that already has one while logged in as another user

  1. Open an incognito window and sign into new.expensify.com as a new User A
  2. Sign into expensify.com as a different user (User B) that has a Free Policy
  3. Navigate to Policies > New Policy > Free
  4. Verify that User A is logged out of NewDot and User B is logged in and brought to the workspace settings. Verify this user has 2 workspaces now. Verify User B does not have any additional workspaces.

Test transition when logged in as another user and tapping inbox task as a workspace user in setup

  1. Open an incognito window and sign into new.expensify.com as a new User A
  2. Sign in to expensify.com as a different user (User B) that has a Free Policy / Workspace but not VBA
  3. Click "Continue Setup"
  4. Verify that User A is logged out of NewDot and User B is logged in and brought to the bank account setup screen to finish setup

Test transition when logged in as another user and tapping inbox task as a workspace user with valid VBA

  1. Open an incognito window and sign into new.expensify.com as User A
  2. Sign in to expensify.com as a different user (User B) that has a Free Policy / Workspace and completely set up VBA
  3. Navigate to expensify.com/admin_policies and select the Workspace
  4. Verify that User A is logged out of NewDot and User B is logged in and brought to the bank account setup screen to finish setup
  • Verify that no errors appear in the JS console

Note: Also test that the mainline case of no users logged into NewDot or OldDot and a user signing up for the first time works fine.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

@marcaaron marcaaron self-assigned this Feb 1, 2022
@marcaaron

marcaaron commented Feb 1, 2022

Copy link
Copy Markdown
Contributor Author

This is mostly working. But for the first test case, additional new workspaces are still created on the existing NewDot account that is logged in and I need to figure out why. SOLVED

Also if you are logged into NewDot on another tab that tab will just crash, but not sure anything needs to be done about that. It seems more important to not interrupt the flow if someone is trying to create a new workspace with a new account.

@marcaaron marcaaron marked this pull request as ready for review February 4, 2022 03:47
@marcaaron marcaaron requested a review from a team as a code owner February 4, 2022 03:47
@MelvinBot MelvinBot requested review from robertjchen and removed request for a team February 4, 2022 03:47
@robertjchen

Copy link
Copy Markdown
Contributor

LGTM, appreciate the detailed test cases!

This is mostly working. But for the first test case, additional new workspaces are still created on the existing NewDot account that is logged in and I need to figure out why.

Got it, I'm guessing that could come in a separate followup PR, right?

Also if you are logged into NewDot on another tab that tab will just crash, but not sure anything needs to be done about that. It seems more important to not interrupt the flow if someone is trying to create a new workspace with a new account.

Totally agree! Definitely shouldn't be an issue, as the user will most likely follow on through the normal flow (in the new tab) and not even notice the old tab.

@marcaaron

Copy link
Copy Markdown
Contributor Author

Got it, I'm guessing that could come in a separate followup PR, right?

Oh! Actually, I solved this with a small change and forgot to leave an update. Multiple workspaces should not be getting created.

@marcaaron marcaaron merged commit 07ba799 into main Feb 4, 2022
@marcaaron marcaaron deleted the marcaaron-fixOldToNewDotTransitionForSignedInUser branch February 4, 2022 22:57
@OSBotify

OSBotify commented Feb 4, 2022

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

OSBotify commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by @marcaaron in version: 1.1.37-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify

OSBotify commented Feb 9, 2022

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.37-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants