π OpenHands: AI-Driven Development
switch to uuid package (#146)
Robert Brennan3b364ca389d4
diff --git a/package-lock.json b/package-lock.jsonindex 07be6d0506..d11d7098b4 100644--- a/package-lock.json+++ b/package-lock.json@@ -47,6 +47,7 @@"socket.io-client": "4.8.3","tailwind-merge": "3.5.0","tailwind-scrollbar": "4.0.2",+ "uuid": "^14.0.0","vite": "8.0.10","zustand": "5.0.12"},@@ -17406,6 +17407,19 @@"node": ">= 0.4.0"}},+ "node_modules/uuid": {+ "version": "14.0.0",+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz",+ "integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==",+ "funding": [+ "https://github.com/sponsors/broofa",+ "https://github.com/sponsors/ctavan"+ ],+ "license": "MIT",+ "bin": {+ "uuid": "dist-node/bin/uuid"+ }+ },"node_modules/valibot": {"version": "1.3.1","resolved": "https://registry.npmjs.org/valibot/-/valibot-1.3.1.tgz",diff --git a/package.json b/package.jsonindex 6f18cba499..bbbc30ec98 100644--- a/package.json+++ b/package.json@@ -46,6 +46,7 @@"socket.io-client": "4.8.3","tailwind-merge": "3.5.0","tailwind-scrollbar": "4.0.2",+ "uuid": "^14.0.0","vite": "8.0.10","zustand": "5.0.12"},diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.jsindex 2c0248801f..493ecf6850 100644--- a/public/mockServiceWorker.js+++ b/public/mockServiceWorker.js@@ -11,6 +11,7 @@ const PACKAGE_VERSION = '2.13.4'const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')const activeClientIds = new Set()+import { v4 as uuidv4 } from 'uuid';addEventListener('install', function () {self.skipWaiting()@@ -112,7 +113,7 @@ addEventListener('fetch', function (event) {return}- const requestId = crypto.randomUUID()+ const requestId = uuidv4();event.respondWith(handleRequest(event, requestId, requestInterceptedAt))})diff --git a/src/api/conversation-service/v1-conversation-service.api.ts b/src/api/conversation-service/v1-conversation-service.api.tsindex ccc4152c8e..f2d24bed79 100644--- a/src/api/conversation-service/v1-conversation-service.api.ts+++ b/src/api/conversation-service/v1-conversation-service.api.ts@@ -1,5 +1,6 @@import { Provider } from "#/types/settings";import { SuggestedTask } from "#/utils/types";+import { v4 as uuidv4 } from 'uuid';import {buildConversationWorkingDir,getAgentServerBaseUrl,@@ -64,7 +65,7 @@ class V1ConversationService {workingDirOverride?: string,): Promise<V1AppConversationStartTask> {const settings = await SettingsService.getSettings();- const conversationId = crypto.randomUUID();+ const conversationId = uuidv4();const workingDir =workingDirOverride ?? buildConversationWorkingDir(conversationId);diff --git a/src/stores/btw-store.ts b/src/stores/btw-store.tsindex d56b030229..e911c1fbc8 100644--- a/src/stores/btw-store.ts+++ b/src/stores/btw-store.ts@@ -1,5 +1,6 @@import { create } from "zustand";import { devtools } from "zustand/middleware";+import { v4 as uuidv4 } from 'uuid';export type BtwStatus = "pending" | "done" | "error";@@ -43,7 +44,7 @@ export const useBtwStore = create<BtwStore>()((set) => ({...initialState,addPending: (conversationId, question) => {- const id = crypto.randomUUID();+ const id = uuidv4();set((s) =>updateEntries(s, conversationId, (entries) => [...entries,