Skip to content

Commit 2ab37dc

Browse files
committed
fix(fathom): apply 14-day overlap to incremental created_after so late transcripts are recaptured
1 parent 5c9a49e commit 2ab37dc

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

apps/sim/connectors/fathom/fathom.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ const logger = createLogger('FathomConnector')
1010

1111
const FATHOM_API_BASE = 'https://api.fathom.ai/external/v1'
1212

13+
const MS_PER_DAY = 24 * 60 * 60 * 1000
14+
15+
/**
16+
* Days subtracted from `lastSyncAt` when computing the incremental `created_after`
17+
* window. Fathom's list endpoint only filters by creation time (no update-based
18+
* filter), so a meeting whose transcript was not yet ready on the sync that first
19+
* saw it would otherwise never be re-listed. The overlap keeps recently-created
20+
* meetings in the window long enough for late transcripts to be retried — the sync
21+
* engine re-attempts meetings whose `getDocument` previously returned null, since
22+
* those are never persisted. Matches the Gong connector's overlap approach.
23+
*/
24+
const INCREMENTAL_OVERLAP_DAYS = 14
25+
1326
/**
1427
* Fathom authenticates external API requests with the `X-Api-Key` header.
1528
* (The API also accepts `Authorization: Bearer` for OAuth-connected apps, but
@@ -370,7 +383,10 @@ export const fathomConnector: ConnectorConfig = {
370383
}
371384
if (inviteeDomain) url.searchParams.append('calendar_invitees_domains[]', inviteeDomain)
372385
if (cursor) url.searchParams.append('cursor', cursor)
373-
if (lastSyncAt) url.searchParams.append('created_after', lastSyncAt.toISOString())
386+
if (lastSyncAt) {
387+
const createdAfter = new Date(lastSyncAt.getTime() - INCREMENTAL_OVERLAP_DAYS * MS_PER_DAY)
388+
url.searchParams.append('created_after', createdAfter.toISOString())
389+
}
374390

375391
logger.info('Listing Fathom meetings', {
376392
hasCursor: Boolean(cursor),

0 commit comments

Comments
 (0)