diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/session/ClientConnectionDetails.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/session/ClientConnectionDetails.java index 90896052..8334e9a9 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/session/ClientConnectionDetails.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/session/ClientConnectionDetails.java @@ -69,6 +69,7 @@ public class ClientConnectionDetails { private ClientConnectionData connectionData = null; private boolean statusChanged = true; + private boolean missingChanged = true; private long startTime = -1; private Consumer statusChangeListener = null; @@ -143,9 +144,9 @@ public class ClientConnectionDetails { if (this.connectionData != null && connectionData != null) { this.statusChanged = - this.connectionData.clientConnection.status != connectionData.clientConnection.status || - BooleanUtils.toBoolean(this.connectionData.missingPing) != BooleanUtils - .toBoolean(connectionData.missingPing); + this.connectionData.clientConnection.status != connectionData.clientConnection.status; + this.missingChanged = BooleanUtils.toBoolean(this.connectionData.missingPing) != BooleanUtils + .toBoolean(connectionData.missingPing); } this.connectionData = connectionData; if (this.startTime < 0) { @@ -157,6 +158,10 @@ public class ClientConnectionDetails { final Supplier> notificationTableSupplier, final PageContext pageContext) { + if (this.connectionData == null) { + return; + } + // Note: This is to update the whole page (by reload) only when the status has changed // while this page was open. This prevent constant page reloads. if (this.statusChanged && System.currentTimeMillis() - this.startTime > Constants.SECOND_IN_MILLIS) { @@ -164,10 +169,6 @@ public class ClientConnectionDetails { return; } - if (this.connectionData == null) { - return; - } - final Form form = this.formHandle.getForm(); form.setFieldValue( Domain.CLIENT_CONNECTION.ATTR_EXAM_USER_SESSION_ID, @@ -177,7 +178,7 @@ public class ClientConnectionDetails { ClientConnection.ATTR_INFO, this.connectionData.clientConnection.info); - if (this.statusChanged) { + if (this.missingChanged) { // update status form.setFieldValue( Domain.CLIENT_CONNECTION.ATTR_STATUS,