Skip to content

Commit c8477f4

Browse files
committed
refactor(TaskHistoryStore): use structuredClone instead of hacky JSON.stringigy and parse methods
1 parent 3c2ef6b commit c8477f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/core/task-persistence/TaskHistoryStore.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ export class TaskHistoryStore {
554554
throw new Error(`[TaskHistoryStore] atomicReadAndUpdate: task ${taskId} not found in cache`)
555555
}
556556
// Deep-copy so a mutating updater cannot alter cached state before persistence.
557-
const snapshot = JSON.parse(JSON.stringify(current)) as HistoryItem
557+
const snapshot = structuredClone(current)
558558
const updated = updater(snapshot)
559559
if (updated.id !== taskId) {
560560
throw new Error(

0 commit comments

Comments
 (0)