Skip to content

Commit

Permalink
Resolve an issue where a incident might not get updated when appropri…
Browse files Browse the repository at this point in the history
…ate.
  • Loading branch information
heathdutton committed May 31, 2018
1 parent 732c590 commit 2075739
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Integration/HealthIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ public function setComponentStatus($incidentStatus = null, $componentStatus = nu
$change = true;
}
if (!empty($incident['incident_updates'])) {
$lastUpdate = reset($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;
}
Expand Down

0 comments on commit 2075739

Please sign in to comment.