From 95c9fac5238feee05791ab2ba9074da6c3c190f2 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Tue, 15 Oct 2024 15:33:06 +0100 Subject: [PATCH 1/3] add ping to scratchpad upon connection --- src/classes/insightsConnection.ts | 33 +++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/classes/insightsConnection.ts b/src/classes/insightsConnection.ts index 85edd732..56f932b4 100644 --- a/src/classes/insightsConnection.ts +++ b/src/classes/insightsConnection.ts @@ -63,6 +63,7 @@ export class InsightsConnection { if (token) { await this.getConfig(); await this.getMeta(); + await this.getScratchpadQuery(""); } }); return this.connected; @@ -447,18 +448,30 @@ export class InsightsConnection { httpsAgent: getHttpsAgent(this.node.details.insecure), }) .then((response: any) => { - kdbOutputLog(`[SCRATCHPAD] Status: ${response.status}`, "INFO"); - if (isTableView && !response.data.error) { - const buffer = new Uint8Array( - response.data.data.map((x: string) => parseInt(x, 16)), - ).buffer; - - response.data.data = handleWSResults(buffer); - response.data.data = handleScratchpadTableRes( - response.data.data, + if (response.data.error) { + kdbOutputLog( + `[SCRATCHPAD] Error occured while executing scratchpad: ${response.data.errorMsg}`, + "ERROR", + ); + } else if (query === "") { + kdbOutputLog( + `[SCRATCHPAD] scratchpad created for connection: ${this.connLabel}`, + "INFO", ); + } else { + kdbOutputLog(`[SCRATCHPAD] Status: ${response.status}`, "INFO"); + if (isTableView && !response.data.error) { + const buffer = new Uint8Array( + response.data.data.map((x: string) => parseInt(x, 16)), + ).buffer; + + response.data.data = handleWSResults(buffer); + response.data.data = handleScratchpadTableRes( + response.data.data, + ); + } + return response.data; } - return response.data; }); return spRes; }, From f1fe8693f723601a44bb9abb0a01cf3ecc534a5a Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Wed, 16 Oct 2024 09:58:53 +0100 Subject: [PATCH 2/3] update package lock --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 875901c3..d7b05d06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kdb", - "version": "1.8.0", + "version": "1.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kdb", - "version": "1.8.0", + "version": "1.9.0", "license": "MIT", "dependencies": { "@vscode/webview-ui-toolkit": "^1.4.0", From f5d7833a1a65e3e5b891a73e595ac006f61aed41 Mon Sep 17 00:00:00 2001 From: Philip Carneiro Date: Thu, 17 Oct 2024 09:49:30 +0100 Subject: [PATCH 3/3] update package-lock json --- package-lock.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1a4bf84b..89f70656 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4087,10 +4087,11 @@ } }, "node_modules/path-to-regexp": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz", - "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==", - "dev": true + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dev": true, + "license": "MIT" }, "node_modules/pend": { "version": "1.2.0",