From 038bdb80810099b8cb0b86ff5677179af519d3fc Mon Sep 17 00:00:00 2001 From: Emiliano Bonilla <56323762+emilbon99@users.noreply.github.com> Date: Sun, 22 Sep 2024 22:02:38 -0700 Subject: [PATCH] [pluto] - fixed unique ID generation in pluto statuses --- pluto/src/status/aether/aggregator.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pluto/src/status/aether/aggregator.ts b/pluto/src/status/aether/aggregator.ts index 03540b103e..fe8ceb1ece 100644 --- a/pluto/src/status/aether/aggregator.ts +++ b/pluto/src/status/aether/aggregator.ts @@ -7,11 +7,11 @@ // License, use of this software will be governed by the Apache License, Version 2.0, // included in the file licenses/APL.txt. -import { TimeStamp } from "@synnaxlabs/x"; +import { id, TimeStamp } from "@synnaxlabs/x"; import { z } from "zod"; import { aether } from "@/aether/aether"; -import { type CrudeSpec,specZ } from "@/status/aether/types"; +import { type CrudeSpec, specZ } from "@/status/aether/types"; export const aggregatorStateZ = z.object({ statuses: specZ.array(), @@ -30,10 +30,9 @@ export class Aggregator extends aether.Composite { } add(spec: CrudeSpec): void { - const time = TimeStamp.now(); this.setState((p) => ({ ...p, - statuses: [...p.statuses, { time, key: time.toString(), ...spec }], + statuses: [...p.statuses, { time: TimeStamp.now(), key: id.id(), ...spec }], })); } }