diff options
author | Artur Signell <artur@vaadin.com> | 2015-04-17 22:36:03 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-05-28 07:52:23 +0000 |
commit | 3b7ddf8aa06379a09ff534ae1a89977164937b89 (patch) | |
tree | 09cc6b8145fb0d6a4a06f3b0e0b35c63d9e07520 /server | |
parent | 5eec2f7aa933d3cf7adbf4fdbb84ed3791318fbe (diff) | |
download | vaadin-framework-3b7ddf8aa06379a09ff534ae1a89977164937b89.tar.gz vaadin-framework-3b7ddf8aa06379a09ff534ae1a89977164937b89.zip |
Backport a resynchronization fix for 7.5 (#15405)
Change-Id: I62178ada54de6a814704dd7e166e9e9e3403c83b
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/communication/ServerRpcHandler.java | 24 | ||||
-rw-r--r-- | server/src/com/vaadin/server/communication/UidlRequestHandler.java | 4 |
2 files changed, 26 insertions, 2 deletions
diff --git a/server/src/com/vaadin/server/communication/ServerRpcHandler.java b/server/src/com/vaadin/server/communication/ServerRpcHandler.java index 450c11f5c4..65fb144810 100644 --- a/server/src/com/vaadin/server/communication/ServerRpcHandler.java +++ b/server/src/com/vaadin/server/communication/ServerRpcHandler.java @@ -76,13 +76,14 @@ public class ServerRpcHandler implements Serializable { private final JsonArray invocations; private final int syncId; private final JsonObject json; + private final boolean resynchronize; public RpcRequest(String jsonString, VaadinRequest request) { json = JsonUtil.parse(jsonString); JsonValue token = json.get(ApplicationConstants.CSRF_TOKEN); if (token == null) { - this.csrfToken = ApplicationConstants.CSRF_TOKEN_DEFAULT_VALUE; + csrfToken = ApplicationConstants.CSRF_TOKEN_DEFAULT_VALUE; } else { String csrfToken = token.asString(); if (csrfToken.equals("")) { @@ -98,6 +99,14 @@ public class ServerRpcHandler implements Serializable { } else { syncId = -1; } + + if (json.hasKey(ApplicationConstants.RESYNCHRONIZE_ID)) { + resynchronize = json + .getBoolean(ApplicationConstants.RESYNCHRONIZE_ID); + } else { + resynchronize = false; + } + invocations = json.getArray(ApplicationConstants.RPC_INVOCATIONS); } @@ -131,6 +140,15 @@ public class ServerRpcHandler implements Serializable { } /** + * Checks if this is a request to resynchronize the client side + * + * @return true if this is a resynchronization request, false otherwise + */ + public boolean isResynchronize() { + return resynchronize; + } + + /** * Gets the entire request in JSON format, as it was received from the * client. * <p> @@ -186,6 +204,10 @@ public class ServerRpcHandler implements Serializable { ui.getConnectorTracker().cleanConcurrentlyRemovedConnectorIds( rpcRequest.getSyncId()); + + if (rpcRequest.isResynchronize()) { + ui.getSession().getCommunicationManager().repaintAll(ui); + } } /** diff --git a/server/src/com/vaadin/server/communication/UidlRequestHandler.java b/server/src/com/vaadin/server/communication/UidlRequestHandler.java index 6e338c5773..33a3669b7f 100644 --- a/server/src/com/vaadin/server/communication/UidlRequestHandler.java +++ b/server/src/com/vaadin/server/communication/UidlRequestHandler.java @@ -80,10 +80,12 @@ public class UidlRequestHandler extends SynchronizedRequestHandler implements // repaint requested or session has timed out and new one is created boolean repaintAll; - // TODO PUSH repaintAll, analyzeLayouts should be + // TODO PUSH analyzeLayouts should be // part of the message payload to make the functionality transport // agnostic + // Resynchronize is sent in the payload but will still support the + // parameter also for compatibility reasons repaintAll = (request .getParameter(ApplicationConstants.URL_PARAMETER_REPAINT_ALL) != null); |