aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java b/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java
index 64e0df1b06..bd20bea9ed 100644
--- a/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java
+++ b/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java
@@ -621,11 +621,7 @@ public class FileUploadHandler implements RequestHandler {
} finally {
session.unlock();
}
- boolean pushEnabled = UI.getCurrent().getPushConfiguration()
- .getPushMode().isEnabled();
- if (!pushEnabled) {
- return true;
- }
+ return true;
// Note, we are not throwing interrupted exception forward as it is
// not a terminal level error like all other exception.
@@ -704,7 +700,20 @@ public class FileUploadHandler implements RequestHandler {
private void cleanStreamVariable(VaadinSession session, final UI ui,
final ClientConnector owner, final String variableName) {
- session.accessSynchronously(() -> ui.getConnectorTracker()
- .cleanStreamVariable(owner.getConnectorId(), variableName));
+ session.accessSynchronously(() -> {
+ ui.getConnectorTracker().cleanStreamVariable(owner.getConnectorId(),
+ variableName);
+
+ // in case of automatic push mode, the client connector
+ // could already have refreshed its StreamVariable
+ // in the ConnectorTracker. For instance, the Upload component
+ // adds its stream variable in its paintContent method, which is
+ // called (indirectly) on each session unlock in case of automatic
+ // pushes.
+ // To cover this case, mark the client connector as dirty, so that
+ // the unlock after this runnable refreshes the StreamVariable
+ // again.
+ owner.markAsDirty();
+ });
}
}