mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 01:33:29 +00:00
Sessions: canonicalize mixed-case session keys
This commit is contained in:
@@ -75,4 +75,32 @@ describe("recordInboundSession", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("normalizes mixed-case session keys before recording and route updates", async () => {
|
||||
const { recordInboundSession } = await import("./session.js");
|
||||
|
||||
await recordInboundSession({
|
||||
storePath: "/tmp/openclaw-session-store.json",
|
||||
sessionKey: "Agent:Main:Telegram:1234:Thread:42",
|
||||
ctx,
|
||||
updateLastRoute: {
|
||||
sessionKey: "agent:main:telegram:1234:thread:42",
|
||||
channel: "telegram",
|
||||
to: "telegram:1234",
|
||||
},
|
||||
onRecordError: vi.fn(),
|
||||
});
|
||||
|
||||
expect(recordSessionMetaFromInboundMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
sessionKey: "agent:main:telegram:1234:thread:42",
|
||||
}),
|
||||
);
|
||||
expect(updateLastRouteMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
sessionKey: "agent:main:telegram:1234:thread:42",
|
||||
ctx,
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user