summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-06-25 13:50:14 +0300
committerLeif Åstrand <leif@vaadin.com>2014-06-25 13:50:14 +0300
commit087bf4215b76107d0b4e4c70e678ad7201270b12 (patch)
tree91c1ad106917e54f99d91e5a116526122003284b
parentf846f8d699ad6f599d91f7f86aa419be9b22b5a8 (diff)
downloadvaadin-framework-087bf4215b76107d0b4e4c70e678ad7201270b12.tar.gz
vaadin-framework-087bf4215b76107d0b4e4c70e678ad7201270b12.zip
Don't complain about missing sync id for critical notifications (#14081)
Change-Id: I351d256230a5cd674a5e1b8066d3e2aef07ff3bf
-rw-r--r--client/src/com/vaadin/client/ApplicationConnection.java13
-rw-r--r--server/src/com/vaadin/server/VaadinService.java2
2 files changed, 12 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java
index 5d696f1ddb..8bc43dda9a 100644
--- a/client/src/com/vaadin/client/ApplicationConnection.java
+++ b/client/src/com/vaadin/client/ApplicationConnection.java
@@ -66,6 +66,7 @@ import com.google.gwt.user.client.Window.ClosingHandler;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConfiguration.ErrorMessage;
+import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent;
import com.vaadin.client.ResourceLoader.ResourceLoadEvent;
import com.vaadin.client.ResourceLoader.ResourceLoadListener;
import com.vaadin.client.communication.HasJavaScriptConnectorHelper;
@@ -1431,10 +1432,16 @@ public class ApplicationConnection implements HasHandlers {
if (json.containsKey(ApplicationConstants.SERVER_SYNC_ID)) {
int syncId = json.getInt(ApplicationConstants.SERVER_SYNC_ID);
- assert (lastSeenServerSyncId == UNDEFINED_SYNC_ID || syncId == lastSeenServerSyncId + 1) : "Newly retrieved server sync id was not exactly one larger than the previous one (new: "
- + syncId + ", last seen: " + lastSeenServerSyncId + ")";
+ /*
+ * Use sync id unless explicitly set as undefined, as is done by
+ * e.g. critical server-side notifications
+ */
+ if (syncId != -1) {
+ assert (lastSeenServerSyncId == UNDEFINED_SYNC_ID || syncId == lastSeenServerSyncId + 1) : "Newly retrieved server sync id was not exactly one larger than the previous one (new: "
+ + syncId + ", last seen: " + lastSeenServerSyncId + ")";
- lastSeenServerSyncId = syncId;
+ lastSeenServerSyncId = syncId;
+ }
} else {
VConsole.error("Server response didn't contain a sync id. "
+ "Please verify that the server is up-to-date and that the response data has not been modified in transmission.");
diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java
index 08bc6f5c79..e8cdcd7055 100644
--- a/server/src/com/vaadin/server/VaadinService.java
+++ b/server/src/com/vaadin/server/VaadinService.java
@@ -59,6 +59,7 @@ import com.vaadin.server.communication.HeartbeatHandler;
import com.vaadin.server.communication.PublishedFileHandler;
import com.vaadin.server.communication.SessionRequestHandler;
import com.vaadin.server.communication.UidlRequestHandler;
+import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.JsonConstants;
import com.vaadin.shared.ui.ui.UIConstants;
import com.vaadin.ui.UI;
@@ -1590,6 +1591,7 @@ public abstract class VaadinService implements Serializable {
json.put("resources", new JSONObject());
json.put("locales", new JSONObject());
json.put("meta", meta);
+ json.put(ApplicationConstants.SERVER_SYNC_ID, -1);
returnString = json.toString();
} catch (JSONException e) {
getLogger().log(Level.WARNING,