Skip to content

Commit

Permalink
Merge pull request #486 from PagerDuty/release/0.13.2-beta.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gsreynolds authored Aug 13, 2024
2 parents e94b80b + 6b3c1ba commit d5ac12e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pd-live-react",
"homepage": "https://pagerduty.github.io/pd-live-react",
"version": "0.13.1-beta.0",
"version": "0.13.2-beta.0",
"private": true,
"dependencies": {
"@chakra-ui/icons": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/config/version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion src/redux/incidents/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function* getIncidentsImpl() {
until,
include: ['first_trigger_log_entries', 'external_references'],
limit: INCIDENTS_PAGINATION_LIMIT,
sort_by: 'created_at:desc',
sort_by: 'incident_number:desc',
};

if (incidentStatus) baseParams.statuses = incidentStatus;
Expand All @@ -129,6 +129,17 @@ export function* getIncidentsImpl() {
connectionStatusMessage: 'Unable to fetch incidents',
});
}
// The incident list API may return duplicate incidents under some circumstances, so as a precaution we'll dedupe the list by incident.id
// Also log a RUM error if we find any duplicates
const duplicateIncidents = incidents.filter((incident, index, self) => self.findIndex((t) => t.id === incident.id) !== index);
const numDuplicateIncidents = duplicateIncidents.length;
if (numDuplicateIncidents > 0) {
// eslint-disable-next-line no-console
console.error('Duplicate incidents found', numDuplicateIncidents);
RealUserMonitoring.trackError(new Error('Duplicate incidents found'), numDuplicateIncidents);
incidents = incidents.filter((incident, index, self) => self.findIndex((t) => t.id === incident.id) === index);
}

return incidents;
}

Expand Down

0 comments on commit d5ac12e

Please sign in to comment.