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

SWC-7126 - Fix bootstrapping redirect bug #5560

Merged

Conversation

nickgros
Copy link
Contributor

@nickgros nickgros commented Oct 23, 2024

SWC-7126

Fix bug where authenticationController might try to use placeController before it has been set


FluentFuture
.from(
whenAllComplete(
featureFlagConfigFuture,
synapsePropertiesFuture,
checkForUserChangeFuture
Copy link
Contributor Author

@nickgros nickgros Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a dependency cycle where AuthenticationControllerImpl.checkForUserChangeFuture may try to call GlobalApplicationStateImpl.goTo, but GlobalApplicationStateImpl.goTo relies on the PlaceController, which is not ready; it is initialized and set in this future's callback (on line 167 (old) / 164 (new).

We'll run the first two futures, but defer running checkForUserChangeFuture until the placeController is set

Comment on lines +173 to +178
whenAllComplete(
// Checking the session may result in a redirect, so this must be invoked after `setPlaceController`
ginjector
.getAuthenticationController()
.getCheckForUserChangeFuture()
)
Copy link
Contributor Author

@nickgros nickgros Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using this whenAllComplete.call pattern just the like the outer future so we can call the wrapping onFailure method if this fails.

)
.call(
() -> {
globalApplicationState.init(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, call globalApplicationState.init

@nickgros nickgros changed the base branch from develop to release-518 October 23, 2024 12:08
@nickgros nickgros changed the title Fix bootstrapping redirect bug SWC-7126 - Fix bootstrapping redirect bug Oct 23, 2024
@jay-hodgson jay-hodgson merged commit a589a0e into Sage-Bionetworks:release-518 Oct 23, 2024
3 checks passed
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.

2 participants