-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix transitions to existing workspaces from OldDot #10949
Changes from 2 commits
17394da
8f4ec05
9c2f0ea
94ddbe0
bf19d4b
08e2218
b4c2972
1c752eb
83a011f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,6 +7,8 @@ import ONYXKEYS from '../ONYXKEYS'; | |||||||||||||
import * as Session from '../libs/actions/Session'; | ||||||||||||||
import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator'; | ||||||||||||||
import * as SessionUtils from '../libs/SessionUtils'; | ||||||||||||||
import Navigation from '../libs/Navigation/Navigation'; | ||||||||||||||
import ROUTES from '../ROUTES'; | ||||||||||||||
|
||||||||||||||
const propTypes = { | ||||||||||||||
/** The data about the current session which will be set once the user is authenticated and we return to this component as an AuthScreen */ | ||||||||||||||
|
@@ -24,6 +26,10 @@ class LogOutPreviousUserPage extends Component { | |||||||||||||
const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionURL, sessionEmail); | ||||||||||||||
if (isLoggingInAsNewUser) { | ||||||||||||||
Session.signOutAndRedirectToSignIn(); | ||||||||||||||
} else { | ||||||||||||||
const exitTo = lodashGet(this.props, 'route.params.exitTo'); | ||||||||||||||
Navigation.dismissModal(); | ||||||||||||||
Navigation.navigate(exitTo || ROUTES.HOME); | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is creating the problem with the "not found" page. We should only navigate to the workspace after it was created from here App/src/libs/actions/Policy.js Line 942 in d312075
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we have 2 cases where we're either transitioning to create a new workspace or transitioning to open an existing workspace. This navigation would be used for an existing workspace (as well as any other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Navigation to the exit to route when not logging in a new user is handled here, which might not have been triggered previously with the Lines 183 to 187 in d312075
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh okay thanks it looks like this is running but not working because the NavigationContainer isn't ready in time. We might need to add a way to queue navigation for when the container is ready. However, this transition logic being split up between AuthScreens calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Good discovery that the NavigationContainer isn't ready, I remember that being a problem before. I would undo this commit where you removed that callback to wait until the navigation is ready e891e71.
Fun fact, all of the logic for transitions used to be in one component called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll draft what a combination of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Kind of, but only when we need to log out a previous user. Sometimes we just log in the transitioning user. I like
I'm quite happy with the current structure of this flow, so if we are going to change it I really want to understand why it's needed. I think there was some talk of making this whole flow into an API command which could be a great way to clean it up. cc @marcaaron because I think you brought this up at one point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Full disclosure I skimmed this thread (sorry I am pre-coffee) but does sound like we could be moving backwards and should maybe create a summary of what the problem is and go from there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this issue has the most context from what I can tell. Maybe one of you can post a summary / plan there and we can get some more thoughts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since fixing these transitions is fairly high priority, I'll update this PR to do that with our current approach and then I'll make a follow up GH to investigate maybe improving the way we handle transitions. |
||||||||||||||
} | ||||||||||||||
}); | ||||||||||||||
} | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chiragsalian Undoing your revert removed this policy type. Do we actually want this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POLICY.TYPE.TEAM
isn't on main, so if you pull main I think this will go away. We don't use it anywhere.