Heartbeat: allow session-id override (with test)

This commit is contained in:
Peter Steinberger
2025-11-26 18:28:02 +01:00
parent 73456a68d7
commit 63bf4683c5
2 changed files with 53 additions and 0 deletions

View File

@@ -95,6 +95,16 @@ export async function runWebHeartbeatOnce(opts: {
});
const cfg = cfgOverride ?? loadConfig();
if (sessionId) {
const storePath = resolveStorePath(cfg.inbound?.reply?.session?.store);
const store = loadSessionStore(storePath);
store[to] = {
...(store[to] ?? {}),
sessionId,
updatedAt: Date.now(),
};
saveSessionStore(storePath, store);
}
const sessionSnapshot = getSessionSnapshot(cfg, to, true);
if (verbose) {
heartbeatLogger.info(