summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-04-17 22:36:03 +0300
committerVaadin Code Review <review@vaadin.com>2015-05-28 07:52:23 +0000
commit3b7ddf8aa06379a09ff534ae1a89977164937b89 (patch)
tree09cc6b8145fb0d6a4a06f3b0e0b35c63d9e07520 /client
parent5eec2f7aa933d3cf7adbf4fdbb84ed3791318fbe (diff)
downloadvaadin-framework-3b7ddf8aa06379a09ff534ae1a89977164937b89.tar.gz
vaadin-framework-3b7ddf8aa06379a09ff534ae1a89977164937b89.zip
Backport a resynchronization fix for 7.5 (#15405)
Change-Id: I62178ada54de6a814704dd7e166e9e9e3403c83b
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ApplicationConnection.java31
1 files changed, 26 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java
index 3a8d69f25a..64511059d9 100644
--- a/client/src/com/vaadin/client/ApplicationConnection.java
+++ b/client/src/com/vaadin/client/ApplicationConnection.java
@@ -863,7 +863,11 @@ public class ApplicationConnection implements HasHandlers {
+ ApplicationConstants.UIDL_PATH + '/');
if (extraParams != null && extraParams.length() > 0) {
- uri = SharedUtil.addGetParameters(uri, extraParams);
+ if (extraParams.equals(getRepaintAllParameters())) {
+ payload.put(ApplicationConstants.RESYNCHRONIZE_ID, true);
+ } else {
+ uri = SharedUtil.addGetParameters(uri, extraParams);
+ }
}
uri = SharedUtil.addGetParameters(uri, UIConstants.UI_ID_PARAMETER
+ "=" + configuration.getUIId());
@@ -1550,10 +1554,27 @@ public class ApplicationConnection implements HasHandlers {
* 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;
+ if (lastSeenServerSyncId == UNDEFINED_SYNC_ID
+ || syncId == (lastSeenServerSyncId + 1)) {
+ lastSeenServerSyncId = syncId;
+ } else {
+ getLogger().warning(
+ "Expected sync id: " + (lastSeenServerSyncId + 1)
+ + ", received: " + syncId
+ + ". Resynchronizing from server.");
+ lastSeenServerSyncId = syncId;
+
+ // Copied from below...
+ ValueMap meta = json.getValueMap("meta");
+ if (meta == null || !meta.containsKey("async")) {
+ // End the request if the received message was a
+ // response, not sent asynchronously
+ endRequest();
+ }
+ resumeResponseHandling(lock);
+ repaintAll();
+ return;
+ }
}
} else {
syncId = -1;