Skip to content

Commit 48e4411

Browse files
committed
fix(fathom): address second round PR review feedback
- Remove redundant 204 status check in deleteFathomWebhook (204 is ok) - Use consistent undefined-guard pattern for all include flags - Add .catch() fallback on webhook creation JSON parse - Change recording_id default from 0 to null to avoid misleading sentinel
1 parent 851c2c9 commit 48e4411

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

apps/sim/lib/webhooks/provider-subscriptions.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ export async function deleteFathomWebhook(webhook: any, requestId: string): Prom
835835
},
836836
})
837837

838-
if (!fathomResponse.ok && fathomResponse.status !== 404 && fathomResponse.status !== 204) {
838+
if (!fathomResponse.ok && fathomResponse.status !== 404) {
839839
fathomLogger.warn(
840840
`[${requestId}] Failed to delete Fathom webhook (non-fatal): ${fathomResponse.status}`
841841
)
@@ -1403,9 +1403,9 @@ export async function createFathomWebhookSubscription(
14031403
destination_url: notificationUrl,
14041404
triggered_for: [triggeredForValue],
14051405
include_summary: includeSummary !== undefined ? Boolean(includeSummary) : true,
1406-
include_transcript: Boolean(includeTranscript),
1407-
include_action_items: Boolean(includeActionItems),
1408-
include_crm_matches: Boolean(includeCrmMatches),
1406+
include_transcript: includeTranscript !== undefined ? Boolean(includeTranscript) : false,
1407+
include_action_items: includeActionItems !== undefined ? Boolean(includeActionItems) : false,
1408+
include_crm_matches: includeCrmMatches !== undefined ? Boolean(includeCrmMatches) : false,
14091409
}
14101410

14111411
fathomLogger.info(`[${requestId}] Creating Fathom webhook`, {
@@ -1423,10 +1423,13 @@ export async function createFathomWebhookSubscription(
14231423
body: JSON.stringify(requestBody),
14241424
})
14251425

1426-
const responseBody = await fathomResponse.json()
1426+
const responseBody = await fathomResponse.json().catch(() => ({}))
14271427

14281428
if (!fathomResponse.ok) {
1429-
const errorMessage = responseBody.message || responseBody.error || 'Unknown Fathom API error'
1429+
const errorMessage =
1430+
(responseBody as Record<string, string>).message ||
1431+
(responseBody as Record<string, string>).error ||
1432+
'Unknown Fathom API error'
14301433
fathomLogger.error(
14311434
`[${requestId}] Failed to create webhook in Fathom for webhook ${webhookData.id}. Status: ${fathomResponse.status}`,
14321435
{ message: errorMessage, response: responseBody }

apps/sim/tools/fathom/list_meetings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const listMeetingsTool: ToolConfig<FathomListMeetingsParams, FathomListMe
114114
(meeting: Record<string, unknown> & { recorded_by?: Record<string, unknown> }) => ({
115115
title: meeting.title ?? '',
116116
meeting_title: meeting.meeting_title ?? null,
117-
recording_id: meeting.recording_id ?? 0,
117+
recording_id: meeting.recording_id ?? null,
118118
url: meeting.url ?? '',
119119
share_url: meeting.share_url ?? '',
120120
created_at: meeting.created_at ?? '',

apps/sim/tools/fathom/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface FathomListMeetingsResponse extends ToolResponse {
2121
meetings: Array<{
2222
title: string
2323
meeting_title: string | null
24-
recording_id: number
24+
recording_id: number | null
2525
url: string
2626
share_url: string
2727
created_at: string

0 commit comments

Comments
 (0)