Skip to content

Commit 319f712

Browse files
author
Bertan Ari
committed
test(task-persistence): cover childTaskId surviving merge when incoming omits it
1 parent 36ec2e6 commit 319f712

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/core/task-persistence/__tests__/mergeMessageSnapshots.spec.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ describe("mergeClineMessageSnapshots", () => {
121121
])
122122
})
123123

124+
it("keeps a disk childTaskId when the matching incoming message omits the key", () => {
125+
const result = mergeClineMessageSnapshots(
126+
[{ messageId: "msg-1", ts: 1, type: "say", say: "subtask_result", text: "done", childTaskId: "child-1" }],
127+
[{ messageId: "msg-1", ts: 1, type: "say", say: "subtask_result", text: "done (updated)" }],
128+
)
129+
130+
expect(result).toEqual([expect.objectContaining({ ts: 1, text: "done (updated)", childTaskId: "child-1" })])
131+
})
132+
124133
it("returns incoming data when either snapshot is not an array", () => {
125134
expect(mergeClineMessageSnapshots(null, [{ ts: 1 }])).toEqual([{ ts: 1 }])
126135
expect(mergeClineMessageSnapshots([], "invalid")).toBe("invalid")

0 commit comments

Comments
 (0)