fix(eve): scope forget, persist capture idempotency, and fail closed
Review findings: delete was not partitioned by scope.key, capture replay after restart could double-write, and Mem0 errors were swallowed as empty recall. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
1d83bb0835
commit
10d6717068
@@ -29,4 +29,19 @@ describe("createIdempotencyGate", () => {
|
||||
await once("op_1", work);
|
||||
expect(calls).toBe(2);
|
||||
});
|
||||
|
||||
it("evicts the oldest id after the cap", async () => {
|
||||
const once = createIdempotencyGate(2);
|
||||
let calls = 0;
|
||||
const work = async () => {
|
||||
calls += 1;
|
||||
};
|
||||
|
||||
await once("op_1", work);
|
||||
await once("op_2", work);
|
||||
await once("op_3", work);
|
||||
await once("op_1", work);
|
||||
|
||||
expect(calls).toBe(4);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user