fix(session-memory): use HHMMSS slug to prevent same-minute overwrites

Custom content and no-session paths fell through to HHMM (4-char)
timestamp slug. Two /new events in the same minute would overwrite.
HHMMSS makes collisions require same-second timing.
This commit is contained in:
zeroaltitude 2026-03-06 19:15:50 -07:00
parent 423dce7ccd
commit 6b998ff746
No known key found for this signature in database
GPG Key ID: 77592FB1C703882E

View File

@ -322,7 +322,7 @@ const saveSessionToMemory: HookHandler = async (event) => {
// If no slug, use timestamp
if (!slug) {
const timeSlug = now.toISOString().split("T")[1].split(".")[0].replace(/:/g, "");
slug = timeSlug.slice(0, 4); // HHMM
slug = timeSlug.slice(0, 6); // HHMMSS — seconds prevent same-minute overwrites
log.debug("Using fallback timestamp slug", { slug });
}