This is an automated email from the ASF dual-hosted git repository.
hainenber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 8853ff19d48 chore(websocket): migrate external uuid usage with Node's
native UUID generator (#37101)
8853ff19d48 is described below
commit 8853ff19d48b62ab2d9dff67a13410d370a0a379
Author: Đỗ Trọng Hải <[email protected]>
AuthorDate: Mon Feb 16 18:05:10 2026 +0700
chore(websocket): migrate external uuid usage with Node's native UUID
generator (#37101)
Signed-off-by: hainenber <[email protected]>
---
superset-websocket/package-lock.json | 53 ------------------------------------
superset-websocket/package.json | 3 --
superset-websocket/src/index.ts | 4 +--
superset-websocket/utils/loadtest.js | 4 +--
4 files changed, 4 insertions(+), 60 deletions(-)
diff --git a/superset-websocket/package-lock.json
b/superset-websocket/package-lock.json
index 57d12e496d4..da0a9accc0f 100644
--- a/superset-websocket/package-lock.json
+++ b/superset-websocket/package-lock.json
@@ -14,19 +14,16 @@
"ioredis": "^5.9.3",
"jsonwebtoken": "^9.0.3",
"lodash": "^4.17.23",
- "uuid": "^11.1.0",
"winston": "^3.19.0",
"ws": "^8.19.0"
},
"devDependencies": {
"@eslint/js": "^9.25.1",
"@types/eslint__js": "^8.42.3",
- "@types/ioredis": "^5.0.0",
"@types/jest": "^29.5.14",
"@types/jsonwebtoken": "^9.0.10",
"@types/lodash": "^4.17.23",
"@types/node": "^25.2.3",
- "@types/uuid": "^10.0.0",
"@types/ws": "^8.18.1",
"@typescript-eslint/eslint-plugin": "^8.55.0",
"@typescript-eslint/parser": "^8.55.0",
@@ -1745,17 +1742,6 @@
"@types/node": "*"
}
},
- "node_modules/@types/ioredis": {
- "version": "5.0.0",
- "resolved":
"https://registry.npmjs.org/@types/ioredis/-/ioredis-5.0.0.tgz",
- "integrity":
"sha512-zJbJ3FVE17CNl5KXzdeSPtdltc4tMT3TzC6fxQS0sQngkbFZ6h+0uTafsRqu+eSLIugf6Yb0Ea0SUuRr42Nk9g==",
- "deprecated": "This is a stub types definition. ioredis provides its own
type definitions, so you do not need this installed.",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "ioredis": "*"
- }
- },
"node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.3",
"resolved":
"https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
@@ -1843,12 +1829,6 @@
"resolved":
"https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
"integrity":
"sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="
},
- "node_modules/@types/uuid": {
- "version": "10.0.0",
- "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
- "integrity":
"sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
- "dev": true
- },
"node_modules/@types/ws": {
"version": "8.18.1",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
@@ -6927,19 +6907,6 @@
"resolved":
"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity":
"sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
- "node_modules/uuid": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
- "integrity":
"sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
- "funding": [
- "https://github.com/sponsors/broofa",
- "https://github.com/sponsors/ctavan"
- ],
- "license": "MIT",
- "bin": {
- "uuid": "dist/esm/bin/uuid"
- }
- },
"node_modules/v8-compile-cache-lib": {
"version": "3.0.1",
"resolved":
"https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
@@ -8477,15 +8444,6 @@
"@types/node": "*"
}
},
- "@types/ioredis": {
- "version": "5.0.0",
- "resolved":
"https://registry.npmjs.org/@types/ioredis/-/ioredis-5.0.0.tgz",
- "integrity":
"sha512-zJbJ3FVE17CNl5KXzdeSPtdltc4tMT3TzC6fxQS0sQngkbFZ6h+0uTafsRqu+eSLIugf6Yb0Ea0SUuRr42Nk9g==",
- "dev": true,
- "requires": {
- "ioredis": "*"
- }
- },
"@types/istanbul-lib-coverage": {
"version": "2.0.3",
"resolved":
"https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
@@ -8568,12 +8526,6 @@
"resolved":
"https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
"integrity":
"sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="
},
- "@types/uuid": {
- "version": "10.0.0",
- "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
- "integrity":
"sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
- "dev": true
- },
"@types/ws": {
"version": "8.18.1",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
@@ -12101,11 +12053,6 @@
"resolved":
"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity":
"sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
- "uuid": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
- "integrity":
"sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="
- },
"v8-compile-cache-lib": {
"version": "3.0.1",
"resolved":
"https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
diff --git a/superset-websocket/package.json b/superset-websocket/package.json
index 1074718083d..22b684aec92 100644
--- a/superset-websocket/package.json
+++ b/superset-websocket/package.json
@@ -22,19 +22,16 @@
"ioredis": "^5.9.3",
"jsonwebtoken": "^9.0.3",
"lodash": "^4.17.23",
- "uuid": "^11.1.0",
"winston": "^3.19.0",
"ws": "^8.19.0"
},
"devDependencies": {
"@eslint/js": "^9.25.1",
"@types/eslint__js": "^8.42.3",
- "@types/ioredis": "^5.0.0",
"@types/jest": "^29.5.14",
"@types/jsonwebtoken": "^9.0.10",
"@types/lodash": "^4.17.23",
"@types/node": "^25.2.3",
- "@types/uuid": "^10.0.0",
"@types/ws": "^8.18.1",
"@typescript-eslint/eslint-plugin": "^8.55.0",
"@typescript-eslint/parser": "^8.55.0",
diff --git a/superset-websocket/src/index.ts b/superset-websocket/src/index.ts
index 6d54bf53adf..5a1587e88b6 100644
--- a/superset-websocket/src/index.ts
+++ b/superset-websocket/src/index.ts
@@ -19,7 +19,7 @@
import * as http from 'http';
import * as net from 'net';
import WebSocket from 'ws';
-import { v4 as uuidv4 } from 'uuid';
+import { randomUUID } from 'crypto';
import jwt, { Algorithm } from 'jsonwebtoken';
import { parse } from 'cookie';
import Redis, { RedisOptions } from 'ioredis';
@@ -168,7 +168,7 @@ export const trackClient = (
): string => {
statsd.increment('ws_connected_client');
- const socketId = uuidv4();
+ const socketId = randomUUID();
sockets[socketId] = socketInstance;
if (channel in channels) {
diff --git a/superset-websocket/utils/loadtest.js
b/superset-websocket/utils/loadtest.js
index b1da94417cf..2cfb618fe9a 100644
--- a/superset-websocket/utils/loadtest.js
+++ b/superset-websocket/utils/loadtest.js
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-const { v4: uuidv4 } = require('uuid');
const Redis = require('ioredis');
const config = require('../config.json');
+const { randomUUID } = require('crypto');
const redis = new Redis(config.redis);
const numClients = 256;
@@ -30,7 +30,7 @@ function pushData() {
const streamId = `${config.redisStreamPrefix}${channelId}`;
const data = {
channel_id: channelId,
- job_id: uuidv4(),
+ job_id: randomUUID(),
status: 'pending',
};