From b7ddae69501232d97f9a1966b62ba0fce6e729a0 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 28 Oct 2024 15:58:45 +0500 Subject: [PATCH] core: fix invalid object-ids generated on desktop --- packages/core/src/utils/object-id.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/core/src/utils/object-id.ts b/packages/core/src/utils/object-id.ts index 76cd670716..8cab59bab0 100644 --- a/packages/core/src/utils/object-id.ts +++ b/packages/core/src/utils/object-id.ts @@ -17,12 +17,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -const supportsPid = - "process" in globalThis && - (typeof process === "undefined" || typeof process.pid !== "number"); const MACHINE_ID = Math.floor(Math.random() * 0xffffff); -const pid = - (supportsPid ? process.pid : Math.floor(Math.random() * 100000)) % 0xffff; +const pid = Math.floor(Math.random() * 100000) % 0xffff; let index = Math.floor(Math.random() * 0xffffff); const PROCESS_UNIQUE = MACHINE_ID.toString(16) + pid.toString(16); export function createObjectId(date = Date.now()): string {