From 442b35ade51bd82c3e345b0833f67e3dbd85885f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 12 Sep 2014 16:49:48 +0300 Subject: [PATCH] Assert that async UIDL processing happens in order (#14643) Change-Id: Ib2502ad9dc4d28eca41e45efd025478d3f4330a0 --- client/src/com/vaadin/client/ApplicationConnection.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java index d182706780..cba9639067 100644 --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@ -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); -- 2.39.5