diff --git a/wise-webapp/src/main/java/com/wisemapping/exceptions/MultipleSessionsOpenException.java b/wise-webapp/src/main/java/com/wisemapping/exceptions/MultipleSessionsOpenException.java index fb4c97e3..6d92a7e0 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exceptions/MultipleSessionsOpenException.java +++ b/wise-webapp/src/main/java/com/wisemapping/exceptions/MultipleSessionsOpenException.java @@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull; public class MultipleSessionsOpenException extends ClientException { - public static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED"; + public static final String MSG_KEY = "MINDMAP_OUTDATED_BY_YOU"; public MultipleSessionsOpenException(@NotNull String msg) { @@ -35,9 +35,4 @@ public class MultipleSessionsOpenException protected String getMsgBundleKey() { return MSG_KEY; } - - @Override - protected Object[] getMsgBundleArgs() { - return new String[]{"you"}; - } } diff --git a/wise-webapp/src/main/java/com/wisemapping/model/User.java b/wise-webapp/src/main/java/com/wisemapping/model/User.java index 2b433ad7..d15d86c5 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/User.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/User.java @@ -20,10 +20,10 @@ package com.wisemapping.model; import org.jetbrains.annotations.Nullable; -import javax.servlet.http.HttpSessionBindingEvent; -import javax.servlet.http.HttpSessionBindingListener; import java.io.Serializable; -import java.util.*; +import java.util.Calendar; +import java.util.HashSet; +import java.util.Set; public class User extends Collaborator @@ -107,8 +107,10 @@ public class User } public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) + return true; + if (o == null || !User.class.getClass().isInstance(o)) + return false; final User user = (User) o; diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java index b5b42130..e815f0f9 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java @@ -192,7 +192,7 @@ public class MindmapController extends BaseController { throw new SessionExpiredException(lastEditor); } } else if (outdated) { - throw new MultipleSessionsOpenException("The map has been updated and not by you. Session lost."); + throw new MultipleSessionsOpenException("Sessions:" + session + ":" + lockInfo.getSession() + "Timestamp: " + timestamp + ": " + lockInfo.getTimestamp()); } } else { throw new SessionExpiredException(lockInfo.getUser()); diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 99046bba..d331a085 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -250,6 +250,7 @@ TEMPORAL_PASSWORD_SENT=Your temporal password has been sent TEMPORAL_PASSWORD_SENT_DETAILS=We've sent you an email that will allow you to reset your password. Please check your email now. TEMPORAL_PASSWORD_SENT_SUPPORT=If you have any problem receiving the email, contact us to support@wisemapping.com MINDMAP_TIMESTAMP_OUTDATED=It's not possible to save your changes because your mindmap has been modified by '{0}'. Refresh the page and try again. +MINDMAP_OUTDATED_BY_YOU=It's not possible to save your changes because map is out of date. Do you have multiple tabs opened ?. Refresh the page and try again. MINDMAP_LOCKED=Map is being edited by {0} <{1}>. Map is opened in read only mode.