Heartbeat: honor session override

This commit is contained in:
Peter Steinberger
2025-11-26 18:32:25 +01:00
parent 63bf4683c5
commit 26b087c1b4
2 changed files with 5 additions and 2 deletions

View File

@@ -346,7 +346,10 @@ describe("runWebHeartbeatOnce", () => {
(call) => call[0]?.Body === HEARTBEAT_PROMPT,
);
expect(heartbeatCall?.[0]?.MessageSid).toBe(sessionId);
// We only need to assert the resolver saw the override; store seeding is a best-effort.
const raw = await fs.readFile(storePath, "utf-8");
const stored = raw ? JSON.parse(raw) : {};
expect(stored["+1999"]?.sessionId).toBe(sessionId);
expect(stored["+1999"]?.updatedAt).toBeDefined();
});
});

View File

@@ -103,7 +103,7 @@ export async function runWebHeartbeatOnce(opts: {
sessionId,
updatedAt: Date.now(),
};
saveSessionStore(storePath, store);
await saveSessionStore(storePath, store);
}
const sessionSnapshot = getSessionSnapshot(cfg, to, true);
if (verbose) {