diff --git a/client/packages/common/package.json b/client/packages/common/package.json index 1f3df7b64d..dca094dc18 100644 --- a/client/packages/common/package.json +++ b/client/packages/common/package.json @@ -51,7 +51,7 @@ "recharts": "^2.5.0", "stylis": "^4.0.13", "stylis-plugin-rtl": "^2.1.1", - "uuid": "^9.0.0", + "uuidv7": "^1.0.0", "zustand": "^4.3.6" }, "devDependencies": { @@ -59,7 +59,6 @@ "@types/css-mediaquery": "^0.1.1", "@types/dompurify": "^3.0.0", "@types/js-cookie": "^3.0.1", - "@types/uuid": "^9.0.1", "css-mediaquery": "^0.1.2" } } diff --git a/client/packages/common/src/utils/functions/FnUtils.ts b/client/packages/common/src/utils/functions/FnUtils.ts index b58e560db4..fcdfaff581 100644 --- a/client/packages/common/src/utils/functions/FnUtils.ts +++ b/client/packages/common/src/utils/functions/FnUtils.ts @@ -1,8 +1,8 @@ import { UUID } from '@common/types'; -import { v4 } from 'uuid'; +import { uuidv7 } from 'uuidv7'; export const FnUtils = { - generateUUID: (): UUID => v4(), + generateUUID: (): UUID => uuidv7(), // eslint-disable-next-line @typescript-eslint/no-explicit-any debounce: any>( callback: T, diff --git a/client/yarn.lock b/client/yarn.lock index 687ba6f001..d80bce9277 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -5209,11 +5209,6 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.7.tgz#5b06ad6894b236a1d2bd6b2f07850ca5c59cf4d6" integrity sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g== -"@types/uuid@^9.0.1": - version "9.0.2" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.2.tgz#ede1d1b1e451548d44919dc226253e32a6952c4b" - integrity sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ== - "@types/ws@^8.0.0", "@types/ws@^8.5.5": version "8.5.5" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" @@ -18337,6 +18332,11 @@ uuid@^9.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== +uuidv7@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/uuidv7/-/uuidv7-1.0.0.tgz#b097dd0d48c5e48edf661199e033f10ebee08cda" + integrity sha512-XkvPwTtSmYwxIE1FSYQTYg79zHL1ZWV5vM/Qyl9ahXCU8enOPPA4bTjzvafvYUB7l2+miv4EqK/qEe75cOXIdA== + v8-compile-cache@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" diff --git a/server/Cargo.lock b/server/Cargo.lock index b648259eff..1c537ef529 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -936,6 +936,12 @@ dependencies = [ "syn 2.0.59", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + [[package]] name = "atomic-waker" version = "1.1.2" @@ -6010,6 +6016,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ + "atomic", "getrandom", ] diff --git a/server/util/Cargo.toml b/server/util/Cargo.toml index 2ddaad8ace..fb2991651e 100644 --- a/server/util/Cargo.toml +++ b/server/util/Cargo.toml @@ -8,7 +8,7 @@ path = "src/lib.rs" [dependencies] sha2 = "0.10.2" -uuid = { version = "1.0.0", features = ["v4"] } +uuid = { version = "1.8.0", features = ["v7"] } chrono = { workspace = true } serde = "1.0.126" env_logger = "0.8.3" diff --git a/server/util/src/uuid.rs b/server/util/src/uuid.rs index 52957f6292..97f1570316 100644 --- a/server/util/src/uuid.rs +++ b/server/util/src/uuid.rs @@ -2,7 +2,7 @@ use uuid::Uuid; /// Generates unique id pub fn uuid() -> String { - Uuid::new_v4().to_string() + Uuid::now_v7().to_string() } pub fn small_uuid() -> String {