@@ -85,6 +85,8 @@ public class ShareApi extends RestHelper {
8585 @ Path ("/share/{user_path}" )
8686 @ Produces ( MediaType .TEXT_PLAIN )
8787 public Response setUserPath ( @ CookieParam (Fields .COOKIE_PATH ) String oldUserPath , @ PathParam ("user_path" ) String userPath , @ CookieParam (Fields .COOKIE_WORKSPACE_HISTORY ) String historyCookie , @ Context HttpServletRequest requestContext ) {
88+
89+ LOGGER .debug ("Got share link to workspace " , userPath );
8890 // user stuff
8991 UserManager user = null ;
9092 try {
@@ -104,17 +106,21 @@ public Response setUserPath( @CookieParam(Fields.COOKIE_PATH) String oldUserPath
104106 history = new WorkspaceHistory ();
105107
106108 // puts current workspace into history
107- if ( history .containsWorkspace (user .getWorkspaceId ()) == false )
109+ if ( history .containsWorkspace (user .getWorkspaceId ()) == false ) {
108110 history .getRecentWorkspaces ().add ( user .getWorkspace () );
111+ LOGGER .debug ("Added shared workspace to history. Wasn't added yet." );
112+ }
109113 history .setCurrentWorkspace ( user .getWorkspaceId () );
114+ LOGGER .info ("Set current workspace id to " , user .getWorkspaceId (), " from " , oldUserPath );
110115
111116 if ( oldUserPath != null && !oldUserPath .isEmpty () && history .containsWorkspace ( oldUserPath ) == false ) {
112117 Workspace workspace = WorkspaceManager .getInstance ().getWorkspace (oldUserPath );
113- if ( workspace != null )
118+ if ( workspace != null ) {
114119 history .getRecentWorkspaces ().add ( workspace );
120+ LOGGER .debug ("Added old workspace to history " , oldUserPath );
121+ }
115122 }
116123
117- history .setCurrentWorkspace ( user .getWorkspaceId () );
118124 historyCookie = history .toCookieJson ();
119125
120126 } catch (IOException e ) {
0 commit comments