From fbe8140937cc9a9e792dd670fcdb7e45c669374f Mon Sep 17 00:00:00 2001 From: fs Date: Sun, 5 Apr 2026 22:21:28 +0200 Subject: [PATCH] fix(helpdesk): drop redundant SOAP message entries when OData has them When the SOAP message map is applied to OData entries, the message text is already embedded in the OData entries. The separate SOAP message entries then cause duplicates with different actor/timestamp metadata. Now: when soapMessageMap was used, filter out SOAP entries with type_variant 'message' since they are already represented in OData. Non-message SOAP entries (status, activity) are kept. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../Helpdesk/Service/TicketCommunicationService.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php b/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php index b946199..34c4fc0 100644 --- a/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php +++ b/modules/helpdesk/lib/Module/Helpdesk/Service/TicketCommunicationService.php @@ -65,6 +65,16 @@ class TicketCommunicationService $odataEntries = $this->mapODataEntries($ticketNo, $ticketLog, $soapMessageMap); } + // When OData entries are enriched with SOAP message text via soapMessageMap, + // the separate SOAP entries for those messages are redundant and cause + // duplicates. Drop SOAP message entries when the map was applied. + if ($soapMessageMap !== [] && $soapEntries !== []) { + $soapEntries = array_values(array_filter( + $soapEntries, + static fn (array $e): bool => ($e['type_variant'] ?? '') !== 'message' + )); + } + if ($actorNameMap !== []) { $odataEntries = $this->applyActorNameMap($odataEntries, $actorNameMap); $soapEntries = $this->applyActorNameMap($soapEntries, $actorNameMap);