From 07ff4884f15557f359de75cc4e900969abe2f63a Mon Sep 17 00:00:00 2001 From: nk-coding Date: Wed, 25 Sep 2024 07:34:43 +0200 Subject: [PATCH 1/2] fix more invalid deletes --- .../IntraComponentDependencySpecificationService.kt | 4 ++-- .../kotlin/gropius/service/architecture/ProjectService.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/kotlin/gropius/service/architecture/IntraComponentDependencySpecificationService.kt b/core/src/main/kotlin/gropius/service/architecture/IntraComponentDependencySpecificationService.kt index 1e84d80f..e35f229b 100644 --- a/core/src/main/kotlin/gropius/service/architecture/IntraComponentDependencySpecificationService.kt +++ b/core/src/main/kotlin/gropius/service/architecture/IntraComponentDependencySpecificationService.kt @@ -143,7 +143,7 @@ class IntraComponentDependencySpecificationService( ) } } - intraComponentDependencyParticipantRepository.deleteAll(participantsToRemove) + intraComponentDependencyParticipantRepository.deleteAll(participantsToRemove).awaitSingleOrNull() if (participants.isEmpty()) { throw IllegalArgumentException("$propertyName must not be empty") } @@ -194,7 +194,7 @@ class IntraComponentDependencySpecificationService( val allParticipants = intraComponentDependencySpecification.let { it.outgoingParticipants() + it.incomingParticipants() } - intraComponentDependencyParticipantRepository.deleteAll(allParticipants) + intraComponentDependencyParticipantRepository.deleteAll(allParticipants).awaitSingleOrNull() repository.delete(intraComponentDependencySpecification).awaitSingleOrNull() } diff --git a/core/src/main/kotlin/gropius/service/architecture/ProjectService.kt b/core/src/main/kotlin/gropius/service/architecture/ProjectService.kt index b60aebdf..fe4c6290 100644 --- a/core/src/main/kotlin/gropius/service/architecture/ProjectService.kt +++ b/core/src/main/kotlin/gropius/service/architecture/ProjectService.kt @@ -107,7 +107,7 @@ class ProjectService( project, Permission(NodePermission.ADMIN, authorizationContext), "delete the Project" ) beforeDeleteTrackable(project) - nodeRepository.deleteAll(project.relationLayouts() + project.relationLayouts()).awaitSingle() + nodeRepository.deleteAll(project.relationLayouts() + project.relationLayouts()).awaitSingleOrNull() repository.delete(project).awaitSingleOrNull() } From 4edf0ba0a49facd11360477862d5f1d62c4e77f6 Mon Sep 17 00:00:00 2001 From: nk-coding Date: Wed, 25 Sep 2024 07:45:56 +0200 Subject: [PATCH 2/2] fix duplicate deletion of trackables --- .../kotlin/gropius/service/architecture/TrackableService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/kotlin/gropius/service/architecture/TrackableService.kt b/core/src/main/kotlin/gropius/service/architecture/TrackableService.kt index d4d5aa3d..634569ff 100644 --- a/core/src/main/kotlin/gropius/service/architecture/TrackableService.kt +++ b/core/src/main/kotlin/gropius/service/architecture/TrackableService.kt @@ -83,7 +83,7 @@ abstract class TrackableService> node.syncsTo().forEach { imsProjectService.deleteIMSProject(it) } - nodeRepository.deleteAll(labelsToDelete + imsProjectsToDelete + issuesToDelete + node.artefacts() + node) + nodeRepository.deleteAll(labelsToDelete + imsProjectsToDelete + issuesToDelete + node.artefacts()) .awaitSingleOrNull() }