Skip to content

Commit 2586e7d

Browse files
waleedlatif1claude
andcommitted
fix(fireflies): guard against NaN timestamp, use stricter V2 detection
Address PR review feedback: - Use Number.isFinite guard to prevent NaN timestamp propagation - Use AND instead of OR for V2 detection since both meeting_id and event are required fields in every V2 payload Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bb42c4d commit 2586e7d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

apps/sim/lib/webhooks/providers/fireflies.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ export const firefliesHandler: WebhookProviderHandler = {
4646
async formatInput({ body }: FormatInputContext): Promise<FormatInputResult> {
4747
const b = body as Record<string, unknown>
4848

49-
// Fireflies V2 webhooks use snake_case field names and "event" instead of "eventType"
50-
const isV2 = typeof b.meeting_id === 'string' || typeof b.event === 'string'
49+
// Fireflies V2 webhooks use snake_case field names and "event" instead of "eventType".
50+
// Both meeting_id and event are required in every V2 payload, so AND is the correct check.
51+
const isV2 = typeof b.meeting_id === 'string' && typeof b.event === 'string'
5152

5253
const meetingId = ((isV2 ? b.meeting_id : b.meetingId) || '') as string
5354
const eventType = ((isV2 ? b.event : b.eventType) || 'Transcription completed') as string
5455
const clientReferenceId = ((isV2 ? b.client_reference_id : b.clientReferenceId) || '') as string
55-
const timestamp = b.timestamp ? Number(b.timestamp) : null
56+
const rawTimestamp = b.timestamp != null ? Number(b.timestamp) : null
57+
const timestamp = rawTimestamp !== null && Number.isFinite(rawTimestamp) ? rawTimestamp : null
5658

5759
return {
5860
input: {

0 commit comments

Comments
 (0)