]> source.dussan.org Git - vaadin-framework.git/commitdiff
Assert that async UIDL processing happens in order (#14643)
authorLeif Åstrand <leif@vaadin.com>
Fri, 12 Sep 2014 13:49:48 +0000 (16:49 +0300)
committerHenri Sara <hesara@vaadin.com>
Mon, 13 Oct 2014 11:39:36 +0000 (11:39 +0000)
Change-Id: Ib2502ad9dc4d28eca41e45efd025478d3f4330a0

client/src/com/vaadin/client/ApplicationConnection.java

index d182706780d24e31ab925214eeeff211e81177e4..cba96390672e501974a73ccc36f5846a05f4a57a 100644 (file)
@@ -1457,8 +1457,9 @@ public class ApplicationConnection implements HasHandlers {
         VConsole.log("Handling message from server");
         eventBus.fireEvent(new ResponseHandlingStartedEvent(this));
 
+        final int syncId;
         if (json.containsKey(ApplicationConstants.SERVER_SYNC_ID)) {
-            int syncId = json.getInt(ApplicationConstants.SERVER_SYNC_ID);
+            syncId = json.getInt(ApplicationConstants.SERVER_SYNC_ID);
 
             /*
              * Use sync id unless explicitly set as undefined, as is done by
@@ -1471,6 +1472,7 @@ public class ApplicationConnection implements HasHandlers {
                 lastSeenServerSyncId = syncId;
             }
         } else {
+            syncId = -1;
             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.");
         }
@@ -1541,6 +1543,8 @@ public class ApplicationConnection implements HasHandlers {
         Command c = new Command() {
             @Override
             public void execute() {
+                assert syncId == -1 || syncId == lastSeenServerSyncId;
+
                 handleUIDLDuration.logDuration(" * Loading widgets completed",
                         10);