From c07de3bd99af967c70848b9e119a723060bbb214 Mon Sep 17 00:00:00 2001 From: tkuzynow Date: Thu, 22 Aug 2024 16:14:51 +0200 Subject: [PATCH] fix: delete rooms even if user is already deleted from MariaDB --- .../RocketChatRemoveFromGroupOperationService.java | 6 ++++++ .../api/facade/assignsession/AssignEnquiryFacade.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/caritas/cob/userservice/api/admin/service/rocketchat/RocketChatRemoveFromGroupOperationService.java b/src/main/java/de/caritas/cob/userservice/api/admin/service/rocketchat/RocketChatRemoveFromGroupOperationService.java index e08560e11..b677724fb 100644 --- a/src/main/java/de/caritas/cob/userservice/api/admin/service/rocketchat/RocketChatRemoveFromGroupOperationService.java +++ b/src/main/java/de/caritas/cob/userservice/api/admin/service/rocketchat/RocketChatRemoveFromGroupOperationService.java @@ -81,6 +81,12 @@ public void removeFromGroupAndIgnoreGroupNotFound() { session.getGroupId(), consultants))); } + public void removeFromGroup() { + this.consultantsToRemoveFromSessions.forEach( + ((session, consultants) -> + removeConsultantsFromSessionGroup(session.getGroupId(), consultants))); + } + /** * Removes the given consultant from Rocket.Chat group of given session with rollback on error. */ diff --git a/src/main/java/de/caritas/cob/userservice/api/facade/assignsession/AssignEnquiryFacade.java b/src/main/java/de/caritas/cob/userservice/api/facade/assignsession/AssignEnquiryFacade.java index 060369c44..9983253bb 100644 --- a/src/main/java/de/caritas/cob/userservice/api/facade/assignsession/AssignEnquiryFacade.java +++ b/src/main/java/de/caritas/cob/userservice/api/facade/assignsession/AssignEnquiryFacade.java @@ -163,7 +163,7 @@ private void removeUnauthorizedMembers( .onSessionConsultants(Map.of(session, consultantsToRemoveFromRocketChat)); if (rcGroupId.equalsIgnoreCase(session.getGroupId())) { - rocketChatRemoveFromGroupOperationService.removeFromGroupAndIgnoreGroupNotFound(); + rocketChatRemoveFromGroupOperationService.removeFromGroup(); } if (rcGroupId.equalsIgnoreCase(session.getFeedbackGroupId())) { rocketChatRemoveFromGroupOperationService.removeFromFeedbackGroup();