fix(ts-oss): return snake_case entity ids from the redis and valkey stores (#6902)

This commit is contained in:
Kartik
2026-08-14 16:56:27 +05:30
committed by GitHub
parent 0f172c2890
commit 956bf4f88e
8 changed files with 225 additions and 73 deletions
+10
View File
@@ -128,6 +128,16 @@ describe("Memory - get()", () => {
expect(item!.createdAt).toBeDefined();
expect(new Date(item!.createdAt!).toString()).not.toBe("Invalid Date");
});
test("does not duplicate the entity id inside metadata", async () => {
const addResult: SearchResult = await memory.add("Metadata leak test", {
userId,
});
const item: any = await memory.get(addResult.results[0].id);
expect(item.user_id).toBe(userId);
expect(item.metadata).not.toHaveProperty("user_id");
expect(item.metadata).not.toHaveProperty("userId");
});
});
// ─── update() ────────────────────────────────────────────