1
0

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) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 22:21:28 +02:00
parent 640da8245d
commit fbe8140937

View File

@@ -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);