File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -372,9 +372,16 @@ export const gongConnector: ConnectorConfig = {
372372 const workspaceId = ( sourceConfig . workspaceId as string | undefined ) ?. trim ( )
373373 const primaryUserIds = parseIdList ( sourceConfig . primaryUserIds )
374374
375+ const cachedWindow = syncContext ?. gongDateWindow as
376+ | { fromDateTime : string ; toDateTime : string }
377+ | undefined
375378 const now = new Date ( )
376- const fromDateTime = new Date ( now . getTime ( ) - lookbackDays * MS_PER_DAY ) . toISOString ( )
377- const toDateTime = now . toISOString ( )
379+ const window = cachedWindow ?? {
380+ fromDateTime : new Date ( now . getTime ( ) - lookbackDays * MS_PER_DAY ) . toISOString ( ) ,
381+ toDateTime : now . toISOString ( ) ,
382+ }
383+ if ( syncContext && ! cachedWindow ) syncContext . gongDateWindow = window
384+ const { fromDateTime, toDateTime } = window
378385
379386 const filter : Record < string , unknown > = { fromDateTime, toDateTime }
380387 if ( workspaceId ) filter . workspaceId = workspaceId
Original file line number Diff line number Diff line change @@ -446,13 +446,14 @@ export const grainConnector: ConnectorConfig = {
446446 const segments = await fetchTranscript ( accessToken , externalId )
447447 if ( ! segments ) return null
448448
449- const content = formatTranscriptContent ( recording , segments )
450449 const hasTranscript = segments . some ( ( segment ) => segment . text ?. trim ( ) )
451450 if ( ! hasTranscript ) {
452451 logger . info ( 'Transcript not yet available for Grain recording' , { externalId } )
453452 return null
454453 }
455454
455+ const content = formatTranscriptContent ( recording , segments )
456+
456457 return {
457458 externalId,
458459 title : recordingTitle ( recording ) ,
You can’t perform that action at this time.
0 commit comments