From f1f075a604a8a9130c520025ff8a8ad2253c0d9d Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Wed, 25 Jun 2025 14:12:26 -0700 Subject: [PATCH 1/5] All telemetry criteria bug (#8084) * Reference telemetry map as a Map, not associative array * Only normalize once * Another cheeky createNormalizedDatum * Fix unit tests that were broken by removal of createNormalizedDatum * Fixed failing test --- src/plugins/persistence/couch/Questions for Vickie.md | 6 ++++++ src/plugins/persistence/couch/Stay Interview notes.md | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/plugins/persistence/couch/Questions for Vickie.md create mode 100644 src/plugins/persistence/couch/Stay Interview notes.md diff --git a/src/plugins/persistence/couch/Questions for Vickie.md b/src/plugins/persistence/couch/Questions for Vickie.md new file mode 100644 index 00000000000..384924b6aa7 --- /dev/null +++ b/src/plugins/persistence/couch/Questions for Vickie.md @@ -0,0 +1,6 @@ +Questions for Vickie +I am remote on Monday and Tuesday for Mel's birthday +Have coordinate with Keith and he can be in the MMOC on Monday to test out the PIV transition +Which machines has PIV been tested from? + +What do we have for CCB on Tuesday? \ No newline at end of file diff --git a/src/plugins/persistence/couch/Stay Interview notes.md b/src/plugins/persistence/couch/Stay Interview notes.md new file mode 100644 index 00000000000..2d0768e9b4f --- /dev/null +++ b/src/plugins/persistence/couch/Stay Interview notes.md @@ -0,0 +1,10 @@ +Stay Interview notes +* Why do I work here? + * Interesting projects, great people, flexibility. + +* What would I like? + * More paid leave. If you can't compete on salary you have to offer competitive benefits. + +* I'd like to work on wild fire detection and management if we have anything going there +* Green energy +* Human spaceflight also interests me. From 5f4b4bb0ff0aa9d0b8b13476fe38ab9542566aa1 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 17 Oct 2025 12:01:46 -0700 Subject: [PATCH 2/5] Don't double stringify requests to views --- src/plugins/persistence/couch/CouchObjectProvider.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/persistence/couch/CouchObjectProvider.js b/src/plugins/persistence/couch/CouchObjectProvider.js index b5e53848fd6..7862a5945ca 100644 --- a/src/plugins/persistence/couch/CouchObjectProvider.js +++ b/src/plugins/persistence/couch/CouchObjectProvider.js @@ -463,7 +463,6 @@ class CouchObjectProvider { { designDoc, viewName, keysToSearch, startKey, endKey, limit, objectIdField }, abortSignal ) { - let stringifiedKeys = JSON.stringify(keysToSearch); const url = `${this.url}/_design/${designDoc}/_view/${viewName}`; const requestBody = {}; let requestBodyString; @@ -485,7 +484,7 @@ class CouchObjectProvider { requestBodyString = requestBodyString.replace('$END_KEY', endKey); /* spell-checker: enable */ } else { - requestBody.keys = stringifiedKeys; + requestBody.keys = keysToSearch; requestBodyString = JSON.stringify(requestBody); } From 3550046eab43a22e42cdacd46d79827184edaa76 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 17 Oct 2025 16:14:52 -0700 Subject: [PATCH 3/5] Add E2E test to catch 400 errors due to double stringification --- .../plugins/plot/tagging.e2e.spec.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js b/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js index e62c65772a3..dcda7a192cf 100644 --- a/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js @@ -118,6 +118,35 @@ test.describe('Plot Tagging', () => { await basicTagsTests(page); }); + test('Plots use index to retrieve tags @couchdb @network', async ({ page }) => { + test.info().annotations.push({ + type: 'issue', + description: 'https://github.com/nasa/openmct/issues/8184' + }); + // Switch to real-time mode + await setRealTimeMode(page); + + const tagsRequestPromise = new Promise((resolve) => { + page.on('request', async (request) => { + const isTagsRequest = request.url().endsWith('by_keystring'); + if (isTagsRequest) { + const response = await request.response(); + resolve(response.status() === 200); + } + }); + }); + await createDomainObjectWithDefaults(page, { + type: 'Sine Wave Generator' + }); + + const pauseButton = page.getByLabel('Pause incoming real-time data'); + pauseButton.click(); + + const didUseIndexForTagsRequest = await tagsRequestPromise; + + expect(didUseIndexForTagsRequest).toBe(true); + }); + test('Tags work with Stacked Plots', async ({ page }) => { const stackedPlot = await createDomainObjectWithDefaults(page, { type: 'Stacked Plot' From 47ae5ea9695e2920761c763c4546de88f1840c14 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 17 Oct 2025 16:20:48 -0700 Subject: [PATCH 4/5] Removed files AGAIN --- src/plugins/persistence/couch/Questions for Vickie.md | 6 ------ src/plugins/persistence/couch/Stay Interview notes.md | 10 ---------- 2 files changed, 16 deletions(-) delete mode 100644 src/plugins/persistence/couch/Questions for Vickie.md delete mode 100644 src/plugins/persistence/couch/Stay Interview notes.md diff --git a/src/plugins/persistence/couch/Questions for Vickie.md b/src/plugins/persistence/couch/Questions for Vickie.md deleted file mode 100644 index 384924b6aa7..00000000000 --- a/src/plugins/persistence/couch/Questions for Vickie.md +++ /dev/null @@ -1,6 +0,0 @@ -Questions for Vickie -I am remote on Monday and Tuesday for Mel's birthday -Have coordinate with Keith and he can be in the MMOC on Monday to test out the PIV transition -Which machines has PIV been tested from? - -What do we have for CCB on Tuesday? \ No newline at end of file diff --git a/src/plugins/persistence/couch/Stay Interview notes.md b/src/plugins/persistence/couch/Stay Interview notes.md deleted file mode 100644 index 2d0768e9b4f..00000000000 --- a/src/plugins/persistence/couch/Stay Interview notes.md +++ /dev/null @@ -1,10 +0,0 @@ -Stay Interview notes -* Why do I work here? - * Interesting projects, great people, flexibility. - -* What would I like? - * More paid leave. If you can't compete on salary you have to offer competitive benefits. - -* I'd like to work on wild fire detection and management if we have anything going there -* Green energy -* Human spaceflight also interests me. From 19749d5458ea5cc5dcff22c7f39b8dd7bfe2c4e8 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 17 Oct 2025 16:49:59 -0700 Subject: [PATCH 5/5] Use design documents in testing --- .../couch/replace-localstorage-with-couchdb-indexhtml.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh b/src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh index 4fbc50d4ec6..dfb79cd0294 100644 --- a/src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh +++ b/src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh @@ -1,3 +1,3 @@ #!/bin/bash -e -sed -i'.bak' -e 's/LocalStorage()/CouchDB("http:\/\/localhost:5984\/openmct")/g' index.html +sed -i'.bak' -e 's/LocalStorage()/CouchDB(\{url: "http:\/\/localhost:5984\/openmct", useDesignDocuments: true\})/g' index.html