Skip to content

Commit

Permalink
Merge pull request #5560 from nickgros/fix-bootstrapping-bug
Browse files Browse the repository at this point in the history
SWC-7126 - Fix bootstrapping redirect bug
  • Loading branch information
jay-hodgson authored Oct 23, 2024
2 parents da9a152 + 82cf75a commit a589a0e
Showing 1 changed file with 59 additions and 33 deletions.
92 changes: 59 additions & 33 deletions src/main/java/org/sagebionetworks/web/client/Portal.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import java.util.HashMap;
import java.util.function.Consumer;
import org.sagebionetworks.schema.adapter.JSONObjectAdapter;
import org.sagebionetworks.web.client.mvp.AppActivityMapper;
import org.sagebionetworks.web.client.mvp.AppPlaceHistoryMapper;
Expand Down Expand Up @@ -92,16 +93,12 @@ public void onSuccess() {
ginjector
.getSynapseProperties()
.getInitSynapsePropertiesFuture();
FluentFuture<Void> checkForUserChangeFuture = ginjector
.getAuthenticationController()
.getCheckForUserChangeFuture();

FluentFuture
.from(
whenAllComplete(
featureFlagConfigFuture,
synapsePropertiesFuture,
checkForUserChangeFuture
synapsePropertiesFuture
)
.call(
() -> {
Expand Down Expand Up @@ -170,38 +167,67 @@ public void onSuccess() {
globalApplicationState.setAppPlaceHistoryMapper(
historyMapper
);
globalApplicationState.init(
new Callback() {
@Override
public void invoke() {
// listen for window close (or navigating away)
registerWindowClosingHandler(
globalApplicationState
);
registerOnPopStateHandler(globalApplicationState);

// start version timer
ginjector.getVersionTimer().start();
// start timer to check for Synapse outage or scheduled maintenance
ginjector.getSynapseStatusDetector().start();
// Goes to place represented on URL or default place
historyHandler.handleCurrentHistory();
globalApplicationState.initializeDropZone();
globalApplicationState.initializeToastContainer();
// initialize the view default columns so that they're ready when we need them (do this by constructing that singleton object)
ginjector.getViewDefaultColumns();
FluentFuture
.from(
whenAllComplete(
// Checking the session may result in a redirect, so this must be invoked after `setPlaceController`
ginjector
.getAuthenticationController()
.getCheckForUserChangeFuture()
)
.call(
() -> {
globalApplicationState.init(
new Callback() {
@Override
public void invoke() {
// listen for window close (or navigating away)
registerWindowClosingHandler(
globalApplicationState
);
registerOnPopStateHandler(
globalApplicationState
);

// start timer to check for user session state change (session expired, or user explicitly logged
// out). Backend endpoints must be set before starting this (because it attempts to get "my user profile")
ginjector.getSessionDetector().start();
// start version timer
ginjector.getVersionTimer().start();
// start timer to check for Synapse outage or scheduled maintenance
ginjector
.getSynapseStatusDetector()
.start();
// Goes to place represented on URL or default place
historyHandler.handleCurrentHistory();
globalApplicationState.initializeDropZone();
globalApplicationState.initializeToastContainer();
// initialize the view default columns so that they're ready when we need them (do this by constructing that singleton object)
ginjector.getViewDefaultColumns();

// start a timer to check to see if we're approaching the max allowable space in the web storage.
// clears out the web storage (cache) if this is the case.
ginjector.getWebStorageMaxSizeDetector().start();
}
}
);
// start timer to check for user session state change (session expired, or user explicitly logged
// out). Backend endpoints must be set before starting this (because it attempts to get "my user profile")
ginjector.getSessionDetector().start();

// start a timer to check to see if we're approaching the max allowable space in the web storage.
// clears out the web storage (cache) if this is the case.
ginjector
.getWebStorageMaxSizeDetector()
.start();
}
}
);
return null;
},
directExecutor()
)
)
.catching(
Throwable.class,
e -> {
onFailure(e);
return null;
},
directExecutor()
);
return null;
},
directExecutor()
Expand Down

0 comments on commit a589a0e

Please sign in to comment.