fix(gateway): don"t let webchat clobber last route

This commit is contained in:
Peter Steinberger
2025-12-12 21:00:33 +00:00
parent 6b4141247e
commit aae49f1d68
2 changed files with 65 additions and 9 deletions

View File

@@ -868,9 +868,7 @@ export async function startGatewayServer(
break;
}
}
const { cfg, storePath, store, entry } = loadSessionEntry(
p.sessionKey,
);
const { storePath, store, entry } = loadSessionEntry(p.sessionKey);
const now = Date.now();
const sessionId = entry?.sessionId ?? randomUUID();
const sessionEntry: SessionEntry = {
@@ -882,12 +880,6 @@ export async function startGatewayServer(
lastChannel: entry?.lastChannel,
lastTo: entry?.lastTo,
};
const mainKey =
(cfg.inbound?.reply?.session?.mainKey ?? "main").trim() || "main";
if (p.sessionKey === mainKey) {
sessionEntry.lastChannel = "webchat";
delete sessionEntry.lastTo;
}
if (store) {
store[p.sessionKey] = sessionEntry;
if (storePath) {