fixed notification confirm for SEB also for delete
This commit is contained in:
parent
0546b97b0a
commit
dffb0e61f8
3 changed files with 4 additions and 11 deletions
|
@ -59,9 +59,8 @@ public interface ClientEventDAO extends EntityDAO<ClientEvent, ClientEvent> {
|
||||||
/** Used to confirm a pending notification so that the notification is not pending anymore
|
/** Used to confirm a pending notification so that the notification is not pending anymore
|
||||||
*
|
*
|
||||||
* @param notificationId the notification identifier
|
* @param notificationId the notification identifier
|
||||||
* @param clientConnectionId the client connection identifier
|
|
||||||
* @return Result refer to the confirmed notification or to en error when happened */
|
* @return Result refer to the confirmed notification or to en error when happened */
|
||||||
Result<ClientNotification> confirmPendingNotification(Long notificationId, Long clientConnectionId);
|
Result<ClientNotification> confirmPendingNotification(Long notificationId);
|
||||||
|
|
||||||
Result<ClientEventRecord> initPingEvent(Long connectionId);
|
Result<ClientEventRecord> initPingEvent(Long connectionId);
|
||||||
|
|
||||||
|
|
|
@ -277,9 +277,7 @@ public class ClientEventDAOImpl implements ClientEventDAO {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Result<ClientNotification> confirmPendingNotification(
|
public Result<ClientNotification> confirmPendingNotification(final Long notificationId) {
|
||||||
final Long notificationId,
|
|
||||||
final Long clientConnectionId) {
|
|
||||||
|
|
||||||
return Result.tryCatch(() -> {
|
return Result.tryCatch(() -> {
|
||||||
final Long pk = this.clientEventRecordMapper
|
final Long pk = this.clientEventRecordMapper
|
||||||
|
|
|
@ -86,9 +86,7 @@ public class SEBClientNotificationServiceImpl implements SEBClientNotificationSe
|
||||||
final Long notificationId = (long) event.getValue();
|
final Long notificationId = (long) event.getValue();
|
||||||
|
|
||||||
this.clientEventDAO.getPendingNotificationByValue(clientConnection.id, notificationId)
|
this.clientEventDAO.getPendingNotificationByValue(clientConnection.id, notificationId)
|
||||||
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(
|
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(notification.id))
|
||||||
notificationId,
|
|
||||||
notification.connectionId))
|
|
||||||
.map(this::removeFromCache)
|
.map(this::removeFromCache)
|
||||||
.onError(error -> log.error("Failed to confirm pending notification: {}", event, error));
|
.onError(error -> log.error("Failed to confirm pending notification: {}", event, error));
|
||||||
|
|
||||||
|
@ -107,9 +105,7 @@ public class SEBClientNotificationServiceImpl implements SEBClientNotificationSe
|
||||||
|
|
||||||
return this.clientEventDAO.getPendingNotification(notificationId)
|
return this.clientEventDAO.getPendingNotification(notificationId)
|
||||||
.map(notification -> this.confirmClientSide(notification, examId, connectionToken))
|
.map(notification -> this.confirmClientSide(notification, examId, connectionToken))
|
||||||
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(
|
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(notificationId))
|
||||||
notificationId,
|
|
||||||
notification.connectionId))
|
|
||||||
.map(this::removeFromCache)
|
.map(this::removeFromCache)
|
||||||
.onError(error -> log.error("Failed to confirm pending notification: {}", notificationId, error));
|
.onError(error -> log.error("Failed to confirm pending notification: {}", notificationId, error));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue