diff --git a/Integration/HealthIntegration.php b/Integration/HealthIntegration.php index c96d420..f7f80c9 100644 --- a/Integration/HealthIntegration.php +++ b/Integration/HealthIntegration.php @@ -31,7 +31,7 @@ public function setComponentStatus($incidentStatus = null, $componentStatus = nu if (!empty($featureSettings['statuspage_component_id'])) { $components = $this->getComponents(); foreach ($components as $component) { - if ($component['id'] === $featureSettings['statuspage_component_id']) { + if (isset($component['id']) && $component['id'] === $featureSettings['statuspage_component_id']) { // Update the component status if needed. if ($componentStatus !== $component['status']) { $clientIdKey = $this->getClientIdKey(); @@ -55,39 +55,41 @@ public function setComponentStatus($incidentStatus = null, $componentStatus = nu $componentIds[] = $component['id']; if (count($incidents)) { foreach ($incidents as $incident) { - $change = false; - if ($incident['status'] !== $incidentStatus) { - $change = true; - } - if (!empty($incident['incident_updates'])) { - // Get the latest incident update. - $updates = []; - foreach ($incident['incident_updates'] as $update) { - $updates[$update['updated_at']] = $update; - } - ksort($updates); - $lastUpdate = end($updates); - if ($lastUpdate['body'] !== $body) { + if (isset($incident['id'])) { + $change = false; + if ($incident['status'] !== $incidentStatus) { $change = true; } - } - if ($change) { - // Update/Close the incident. - if (!empty($lastUpdate)) { - foreach ($lastUpdate['affected_components'] as $affectedComponent) { - if (!empty($affectedComponent['id'])) { - $componentIds[] = $affectedComponent['id']; + if (!empty($incident['incident_updates'])) { + // Get the latest incident update. + $updates = []; + foreach ($incident['incident_updates'] as $update) { + $updates[$update['updated_at']] = $update; + } + ksort($updates); + $lastUpdate = end($updates); + if ($lastUpdate['body'] !== $body) { + $change = true; + } + } + if ($change) { + // Update/Close the incident. + if (!empty($lastUpdate)) { + foreach ($lastUpdate['affected_components'] as $affectedComponent) { + if (!empty($affectedComponent['id'])) { + $componentIds[] = $affectedComponent['id']; + } } } + $componentIds = array_unique($componentIds); + $this->updateIncident( + $incident['id'], + $incidentStatus, + $name, + $body, + $componentIds + ); } - $componentIds = array_unique($componentIds); - $this->updateIncident( - $incident['id'], - $incidentStatus, - $name, - $body, - $componentIds - ); } } } elseif ('resolved' !== $incidentStatus) { diff --git a/Model/HealthModel.php b/Model/HealthModel.php index 1db5045..5c31d56 100644 --- a/Model/HealthModel.php +++ b/Model/HealthModel.php @@ -183,7 +183,7 @@ public function reportIncidents(OutputInterface $output = null) return; } if ($this->incidents && !empty($this->settings['statuspage_component_id'])) { - $name = 'Degraded Performance'; + $name = 'Processing Delays'; $body = []; foreach ($this->incidents as $campaignId => $campaign) { foreach ($campaign as $incident) {