Skip to content

Commit c7b94e4

Browse files
authored
Don't map twice (#7976)
1 parent b05f22a commit c7b94e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/sessionParsing.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,10 @@ export function parseSessionLogs(rawText: string): SessionResponseLogChunk[] {
320320
const parts = rawText
321321
.split(/\r?\n/)
322322
.filter(part => part.startsWith('data: '))
323-
.map(part => part.slice('data: '.length).trim())
324-
.map(part => JSON.parse(part));
323+
.map(part => {
324+
const trimmed = part.slice('data: '.length).trim();
325+
return JSON.parse(trimmed);
326+
});
325327

326328
return parts as SessionResponseLogChunk[];
327329
}

0 commit comments

Comments
 (0)