File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -7,17 +7,6 @@ import { formatMessagesAsText } from './utils'
77const lookbackHours = Number . parseInt ( HISTORY_LOOKBACK_HOURS || '0' )
88
99export const fetchRelevantHistory = async ( messages : Message [ ] ) : Promise < string > => {
10- logger . debug (
11- {
12- original : messages [ 0 ] . timestamp ,
13- isoParsed : new Date ( messages [ 0 ] . timestamp ) . toISOString ( ) ,
14- localParsed : new Date ( messages [ 0 ] . timestamp ) . toLocaleString ( 'en-US' , {
15- timeZone : 'America/Los_Angeles' ,
16- } ) ,
17- } ,
18- 'Timestamp interpretation test'
19- )
20-
2110 try {
2211 if ( ! lookbackHours || messages . length === 0 ) {
2312 logger . warn ( 'No messages or invalid lookbackHours; skipping history fetch' )
Original file line number Diff line number Diff line change @@ -45,15 +45,18 @@ export const extractReplies = (rawOutput: string): string[] => {
4545 return cleanReplyText ( currentMatch [ 1 ] || currentMatch [ 2 ] || '' )
4646 } )
4747 . filter ( Boolean )
48+
4849 return replies
4950}
5051
5152export const safeCompare = ( a : string , b : string ) : boolean => {
5253 const len = Math . max ( a . length , b . length )
5354 const aBuf = Buffer . alloc ( len , 0 )
5455 const bBuf = Buffer . alloc ( len , 0 )
56+
5557 Buffer . from ( a ) . copy ( aBuf )
5658 Buffer . from ( b ) . copy ( bBuf )
59+
5760 return timingSafeEqual ( aBuf , bBuf ) && a . length === b . length
5861}
5962
You can’t perform that action at this time.
0 commit comments