diff --git a/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/NotificationService.kt b/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/NotificationService.kt index 9ccdf87d6..719bba27c 100644 --- a/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/NotificationService.kt +++ b/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/NotificationService.kt @@ -48,7 +48,9 @@ class NotificationService( notificationTrigger ).bind() .map { - val filteredEntity = previousAndUpdatedExpandedEntities.second.filterAttributes( + // using the "previous" entity (it is actually the previous only for deleted entity events) + // to be able to send deleted attributes in case of a entityDeleted event + val filteredEntity = previousAndUpdatedExpandedEntities.first.filterAttributes( it.notification.attributes?.toSet().orEmpty(), it.datasetId?.toSet().orEmpty() )