diff options
-rw-r--r-- | client/src/com/vaadin/client/ApplicationConnection.java | 13 | ||||
-rw-r--r-- | server/src/com/vaadin/server/VaadinService.java | 2 |
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, |