fix(imip): group messages by logging principal and uri as context

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
pull/54016/head
Daniel Kesselberg 3 months ago
parent 51a09438bf
commit 9bbbd11191
No known key found for this signature in database
GPG Key ID: 4A81C29F63464E8F
  1. 10
      lib/private/Calendar/Manager.php
  2. 4
      tests/lib/Calendar/ManagerTest.php

@ -403,7 +403,10 @@ class Manager implements IManager {
}
if (empty($found)) {
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $vEvent->{'UID'}->getValue());
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar', [
'principalUri' => $principalUri,
'eventUid' => $vEvent->{'UID'}->getValue(),
]);
return false;
}
@ -518,7 +521,10 @@ class Manager implements IManager {
}
if (empty($found)) {
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $vEvent->{'UID'}->getValue());
$this->logger->warning('iMip message event could not be processed because no corresponding event was found in any calendar', [
'principalUri' => $principalUri,
'eventUid' => $vEvent->{'UID'}->getValue(),
]);
return false;
}

@ -1075,7 +1075,7 @@ class ManagerTest extends TestCase {
$calendarData->add('METHOD', 'REPLY');
// construct logger return
$this->logger->expects(self::once())->method('warning')
->with('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $calendarData->VEVENT->UID->getValue());
->with('iMip message event could not be processed because no corresponding event was found in any calendar', ['principalUri' => $principalUri, 'eventUid' => $calendarData->VEVENT->UID->getValue()]);
// Act
$result = $manager->handleIMipReply($principalUri, $sender, $recipient, $calendarData->serialize());
// Assert
@ -1523,7 +1523,7 @@ class ManagerTest extends TestCase {
$calendarData->add('METHOD', 'CANCEL');
// construct logger return
$this->logger->expects(self::once())->method('warning')
->with('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $calendarData->VEVENT->UID->getValue());
->with('iMip message event could not be processed because no corresponding event was found in any calendar', ['principalUri' => $principalUri, 'eventUid' => $calendarData->VEVENT->UID->getValue()]);
// Act
$result = $manager->handleIMipCancel($principalUri, $sender, $replyTo, $recipient, $calendarData->serialize());
// Assert

Loading…
Cancel
Save