From 0e7010a154474d89209a23f64aca4acd33eac605 Mon Sep 17 00:00:00 2001 From: dechoma Date: Thu, 13 Feb 2025 05:53:13 +0100 Subject: [PATCH] fix announcement owner or follower (#19548) --- .../service/util/SubscriptionUtil.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java index 7bef5e5ed20..bea22fb5cd0 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/util/SubscriptionUtil.java @@ -377,12 +377,19 @@ public class SubscriptionUtil { // TODO: For Announcement, Immediate Consumer needs to be Notified (find information from // Lineage) case Announcement -> { - receiverUrls.addAll(buildReceivers(action, category, type, event, event.getEntityId())); + receiverUrls.addAll( + buildReceivers( + action, + category, + type, + thread.getEntityRef().getType(), + thread.getEntityRef().getId())); } } } else { EntityInterface entityInterface = getEntity(event); - receiverUrls.addAll(buildReceivers(action, category, type, event, entityInterface.getId())); + receiverUrls.addAll( + buildReceivers(action, category, type, event.getEntityType(), entityInterface.getId())); } return receiverUrls; @@ -392,12 +399,12 @@ public class SubscriptionUtil { SubscriptionAction action, SubscriptionDestination.SubscriptionCategory category, SubscriptionDestination.SubscriptionType type, - ChangeEvent event, + String entityType, UUID id) { Set result = new HashSet<>(); result.addAll( buildReceiversListFromActions( - action, category, type, Entity.getCollectionDAO(), id, event.getEntityType())); + action, category, type, Entity.getCollectionDAO(), id, entityType)); return result; }