Skip to content

Commit

Permalink
create better uuids
Browse files Browse the repository at this point in the history
see codeQL alert #
  • Loading branch information
Garfonso committed Nov 12, 2024
1 parent ca11c1b commit 382c049
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/modules/todo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const {WebSocket} = require('ws');
const {updateTimestamps, processCommon} = require('../entities/utils');
const crypto = require('crypto');

const TodoItemStatus = {
NeedsAction: 'needs_action',
Expand Down Expand Up @@ -122,7 +123,7 @@ class TodoModule {
const todoList = await this._getTodoList(entity);
todoList.items.push({
name: message.name,
uid: Math.floor(Math.random() * Date.now()),
uid: crypto.randomUUID(),
status: TodoItemStatus.NeedsAction,
due: null,
description: null
Expand Down Expand Up @@ -220,7 +221,7 @@ class TodoModule {
const todoList = await this._getTodoList(entity);
const item = {
summary: data.service_data.item,
uid: Math.floor(Math.random() * Date.now()),
uid: crypto.randomUUID(),
status: TodoItemStatus.NeedsAction,
due: null,
description: null
Expand Down

0 comments on commit 382c049

Please sign in to comment.