private ApplicationConnection connection;
private boolean hasActiveRequest = false;
+ private boolean resynchronizeRequested = false;
/**
* Counter for the messages send to the server. First sent message has id 0.
private void doSendInvocationsToServer() {
ServerRpcQueue serverRpcQueue = getServerRpcQueue();
- if (serverRpcQueue.isEmpty()) {
+ if (serverRpcQueue.isEmpty() && !resynchronizeRequested) {
return;
}
JsonArray reqJson = serverRpcQueue.toJson();
serverRpcQueue.clear();
- if (reqJson.length() == 0) {
+ if (reqJson.length() == 0 && !resynchronizeRequested) {
// Nothing to send, all invocations were filtered out (for
// non-existing connectors)
getLogger().warning(
Version.getFullVersion());
connection.getConfiguration().setWidgetsetVersionSent();
}
+ if (resynchronizeRequested) {
+ getLogger().info("Resynchronizing from server");
+ extraJson.put(ApplicationConstants.RESYNCHRONIZE_ID, true);
+ resynchronizeRequested = false;
+ }
if (showLoadingIndicator) {
connection.getLoadingIndicator().trigger();
}
hasActiveRequest = false;
if (connection.isApplicationRunning()) {
- if (getServerRpcQueue().isFlushPending()) {
+ if (getServerRpcQueue().isFlushPending()
+ || resynchronizeRequested) {
sendInvocationsToServer();
}
runPostRequestHooks(connection.getConfiguration().getRootPanelId());
*/
public void resynchronize() {
getMessageHandler().onResynchronize();
- getLogger().info("Resynchronizing from server");
- JsonObject resyncParam = Json.createObject();
- resyncParam.put(ApplicationConstants.RESYNCHRONIZE_ID, true);
- send(Json.createArray(), resyncParam);
+ getLogger().info("Resynchronize from server requested");
+ resynchronizeRequested = true;
+ sendInvocationsToServer();
}
/**