Repository navigation
Fixes #24691: Deduplicate recipients across multiple EventSubscription destinations - #25312
Conversation
e3a51cc to
3cfa35f
Compare
6c18194 to
02773f9
Compare
02773f9 to
ee70b6c
Compare
|
…te notifications # Conflicts: # openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/changeEvent/AbstractEventConsumer.java
…d of resolving internally # Conflicts: # openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowEventConsumer.java
…ination recipient deduplication
…pping non-recipient destinations
🔍 CI failure analysis for 3edfb26: maven-sonarcloud-ci: IDENTICAL 53 test failures as maven-postgresql-ci (entity CRUD, data contracts, field loading). Combined analysis: all 10 CI failure categories across 14+ jobs are UNRELATED to PR's notification/alert recipient deduplication changes.Issuemaven-sonarcloud-ci (job 60986229556) failed with 53 test failures out of 7891 tests after ~3.5 hours of execution. These are IDENTICAL to the maven-postgresql-ci failures. Combined with previous analysis, all 10 CI failure categories across 14+ jobs are UNRELATED to the PR. Root Causemaven-sonarcloud-ci has the exact same 53 test failures as maven-postgresql-ci, falling into three distinct categories, none connected to notification/alert recipient deduplication: 1. Bulk Loading & Field Fetchers (~40+ failures)
2. Data Contract ODCS Tests (7 failures)
3. Miscellaneous Entity Tests (6 failures)
Infrastructure Issues
DetailsKey Observation: Both maven-postgresql-ci and maven-sonarcloud-ci show IDENTICAL test failures. This strongly suggests:
PR Changes:
Failing Tests:
Complete CI Failure Summary (10 categories, 14+ jobs):
PR modifies: Backend Java notification/alert recipient resolution Failures involve: Entity CRUD, field loading, data contracts, UI E2E tests, Python ingestion, test infrastructure Overlap: NONE Code Review ✅ Approved 3 resolved / 5 findingsWell-structured deduplication fix that correctly addresses duplicate notification issues while preserving destination-specific configurations in Recipient objects. Suggestions 💡 2 suggestionsEdge Case: extractActionConfig silently returns null for unknown typesThe Suggested fix: Either log a warning for unknown types, throw an exception, or ensure comprehensive handling of all enum values: default -> {
LOG.warn("Unknown destination type: {}", destination.getType());
return null;
}Performance: RecipientResolver instantiated on every sendAlert callA new Suggested fix: Make Resolved ✅ 3 resolvedBug: Different destination configs for same type are merged, first used
Bug: Only first destination used per type, ignoring other configurations
Bug: Grouping by type may send same message to only one destination
What Works WellClean architectural refactor moving recipient resolution from individual publishers to a centralized location. Comprehensive integration tests verify deduplication works across multiple destinations. Good use of Tip Comment OptionsAuto-apply is off Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | This comment will update automatically (Docs) |



Fixes #24691
Problem
When an
EventSubscriptionincludes multiple destinations that resolve to overlapping recipients, users received duplicate notifications. For example:[email protected]{[email protected], [email protected]}Result:
[email protected]received two identical emails.Additionally, PATCH operations on
EventSubscriptions with multiple destinations of the same type caused duplicate destination UUID entries to be created. This happened because the UI matched destinations by type only, leading to mismatches when multiple destinations of the same type existed.Root Cause
Two interconnected issues:
No global recipient deduplication across destinations
Each destination resolved recipients independently, and internal deduplication only occurred within a single destination.
No stable destination identifiers for PATCH operations
Without unique IDs, the UI couldn't correctly identify which destination was being updated, leading to duplicates when patching subscriptions with multiple destinations with the exact same UUID (Which afterwards only one of them received the notification).
Solution
Added unique IDs to destinations (
EventSubscriptionRepository.ensureDestinationIds()):ALERT_PATCH_FIELDSandALERT_UPDATE_FIELDSto includedestinationsUpdated UI destination matching (
AlertsClassBase.ts):typeto matching byidModified
RecipientResolverSet<Recipient>across all destinationsUpdated
AbstractEventConsumer.publishEvents()HashSetChanged
Destination.sendMessage()interfaceUpdated all publishers
Testing
RecipientResolverIntegrationTestthat verify:test_recipientDeduplication_acrossMultipleDestinations:Same recipient in OWNERS + EXTERNAL destinations → receives only one notification
test_recipientDeduplication_withMixedOverlappingRecipients:Mix of overlapping and unique recipients → correctly deduplicated
AlertPublisherTestfor the new interface signatureType of change
Checklist
Fixes <issue-number>: <short explanation>