fixed notification confirm for SEB also for delete

This commit is contained in:
anhefti 2021-09-16 11:55:36 +02:00
parent 0546b97b0a
commit dffb0e61f8
3 changed files with 4 additions and 11 deletions

View file

@ -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
*
* @param notificationId the notification identifier
* @param clientConnectionId the client connection identifier
* @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);

View file

@ -277,9 +277,7 @@ public class ClientEventDAOImpl implements ClientEventDAO {
@Override
@Transactional
public Result<ClientNotification> confirmPendingNotification(
final Long notificationId,
final Long clientConnectionId) {
public Result<ClientNotification> confirmPendingNotification(final Long notificationId) {
return Result.tryCatch(() -> {
final Long pk = this.clientEventRecordMapper

View file

@ -86,9 +86,7 @@ public class SEBClientNotificationServiceImpl implements SEBClientNotificationSe
final Long notificationId = (long) event.getValue();
this.clientEventDAO.getPendingNotificationByValue(clientConnection.id, notificationId)
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(
notificationId,
notification.connectionId))
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(notification.id))
.map(this::removeFromCache)
.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)
.map(notification -> this.confirmClientSide(notification, examId, connectionToken))
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(
notificationId,
notification.connectionId))
.flatMap(notification -> this.clientEventDAO.confirmPendingNotification(notificationId))
.map(this::removeFromCache)
.onError(error -> log.error("Failed to confirm pending notification: {}", notificationId, error));
}