From ec978f3a35603d91f7b08df6ebd268b0da163e35 Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Mon, 23 Mar 2020 14:21:46 -0700 Subject: [PATCH 1/3] when a time system is changed, it emits a timeSystem update as well as a bounds update, this caused telemetry table to request data twice when users changed time systems --- src/plugins/telemetryTable/TelemetryTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/telemetryTable/TelemetryTable.js b/src/plugins/telemetryTable/TelemetryTable.js index 2bf4e1c700..57b6458ca5 100644 --- a/src/plugins/telemetryTable/TelemetryTable.js +++ b/src/plugins/telemetryTable/TelemetryTable.js @@ -181,7 +181,7 @@ define([ } refreshData(bounds, isTick) { - if (!isTick) { + if (!isTick && this.outstandingRequests === 0) { this.filteredRows.clear(); this.boundedRows.clear(); this.boundedRows.sortByTimeSystem(this.openmct.time.timeSystem()); From ca022b8a287bc40a58109f4eb3e468828186369c Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Wed, 25 Mar 2020 11:11:17 -0700 Subject: [PATCH 2/3] make a copy of filters before checking isEqual - to prevent using same pointer --- src/plugins/plot/src/configuration/PlotSeries.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/plot/src/configuration/PlotSeries.js b/src/plugins/plot/src/configuration/PlotSeries.js index 8f97c4a809..b8a5672e21 100644 --- a/src/plugins/plot/src/configuration/PlotSeries.js +++ b/src/plugins/plot/src/configuration/PlotSeries.js @@ -377,8 +377,11 @@ define([ * @public */ updateFiltersAndRefresh: function (updatedFilters) { - if (this.filters && !_.isEqual(this.filters, updatedFilters)) { - this.filters = updatedFilters; + let deepCopiedFilters = JSON.parse(JSON.stringify(updatedFilters)); + + if (this.filters && !_.isEqual(this.filters, deepCopiedFilters)) { + console.log('actually updating'); + this.filters = deepCopiedFilters; this.reset(); if (this.unsubscribe) { this.unsubscribe(); @@ -386,7 +389,7 @@ define([ } this.fetch(); } else { - this.filters = updatedFilters; + this.filters = deepCopiedFilters; } } }); From 761ca7ad5695995abd10a13ac5699a2b900ecb01 Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Wed, 25 Mar 2020 11:16:25 -0700 Subject: [PATCH 3/3] remove console log --- src/plugins/plot/src/configuration/PlotSeries.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/plot/src/configuration/PlotSeries.js b/src/plugins/plot/src/configuration/PlotSeries.js index b8a5672e21..06f1fa7da0 100644 --- a/src/plugins/plot/src/configuration/PlotSeries.js +++ b/src/plugins/plot/src/configuration/PlotSeries.js @@ -380,7 +380,6 @@ define([ let deepCopiedFilters = JSON.parse(JSON.stringify(updatedFilters)); if (this.filters && !_.isEqual(this.filters, deepCopiedFilters)) { - console.log('actually updating'); this.filters = deepCopiedFilters; this.reset(); if (this.unsubscribe) {