mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-23 02:23:33 +08:00
review: apply sanitizeSessionId to UUID shortId, fix test comment
- Route the transcript-derived shortId through sanitizeSessionId so the fallback and transcript branches remain byte-for-byte equivalent for any non-UUID session IDs that still land in CLAUDE_SESSION_ID (greptile P1). - Clarify the inline comment in the first regression test: clearing CLAUDE_SESSION_ID exercises the transcript_path branch, not the getSessionIdShort() fallback (coderabbit P2). Refs #1494
This commit is contained in:
@@ -16,6 +16,7 @@ const {
|
||||
getDateString,
|
||||
getTimeString,
|
||||
getSessionIdShort,
|
||||
sanitizeSessionId,
|
||||
getProjectName,
|
||||
ensureDir,
|
||||
readFile,
|
||||
@@ -202,7 +203,11 @@ async function main() {
|
||||
let shortId = null;
|
||||
if (transcriptPath) {
|
||||
const m = path.basename(transcriptPath).match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i);
|
||||
if (m) { shortId = m[1].slice(-8).toLowerCase(); }
|
||||
if (m) {
|
||||
// Run through sanitizeSessionId() for byte-for-byte parity with
|
||||
// getSessionIdShort(sessionId.slice(-8)).
|
||||
shortId = sanitizeSessionId(m[1].slice(-8).toLowerCase());
|
||||
}
|
||||
}
|
||||
if (!shortId) { shortId = getSessionIdShort(); }
|
||||
const sessionFile = path.join(sessionsDir, `${today}-${shortId}-session.tmp`);
|
||||
|
||||
Reference in New Issue
Block a user