From 73d9a4c3b01d86091d39f065391104a32a99a12f Mon Sep 17 00:00:00 2001 From: Gavin Reynolds Date: Wed, 7 Aug 2024 15:24:13 +0100 Subject: [PATCH 1/3] Sort by incident_number and not created_by to ensure stable sorting Signed-off-by: Gavin Reynolds --- src/redux/incidents/sagas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redux/incidents/sagas.js b/src/redux/incidents/sagas.js index 81f792af..a535eb86 100644 --- a/src/redux/incidents/sagas.js +++ b/src/redux/incidents/sagas.js @@ -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; From b632bd26a5f1f5f3a56f527618b894ebde14ac45 Mon Sep 17 00:00:00 2001 From: Gavin Reynolds Date: Wed, 7 Aug 2024 16:18:23 +0100 Subject: [PATCH 2/3] The incident list API may return duplicate incidents under some circumstances, so as a precaution we'll dedupe the list by incident.id Signed-off-by: Gavin Reynolds --- src/redux/incidents/sagas.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/redux/incidents/sagas.js b/src/redux/incidents/sagas.js index a535eb86..3c492ee4 100644 --- a/src/redux/incidents/sagas.js +++ b/src/redux/incidents/sagas.js @@ -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; } From 6b3c1ba1d8db925528c993842fbe8d518b546628 Mon Sep 17 00:00:00 2001 From: Gavin Reynolds Date: Thu, 8 Aug 2024 15:11:32 +0100 Subject: [PATCH 3/3] Publishing release v0.13.2-beta.0 Signed-off-by: Gavin Reynolds --- package.json | 2 +- src/config/version.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a97ff745..e99e0492 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/config/version.js b/src/config/version.js index aa9311bf..a2e84652 100644 --- a/src/config/version.js +++ b/src/config/version.js @@ -1,2 +1,2 @@ // Generated by genversion. -export const version = '0.13.1-beta.0'; +export const version = '0.13.2-beta.0';