Skip to content

Commit 7116c40

Browse files
committed
fix(connectors): throw on misconfigured typeform/zendesk sources instead of returning null
A null from getDocument reads as documented absence, so on an add the document is dropped with neither a failure counter nor a log. Both listDocuments paths already throw on the same missing config.
1 parent 675ffa9 commit 7116c40

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

apps/sim/connectors/typeform/typeform.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,13 @@ export const typeformConnector: ConnectorConfig = {
481481
syncContext?: Record<string, unknown>
482482
): Promise<ExternalDocument | null> => {
483483
const formId = (sourceConfig.formId as string)?.trim()
484-
if (!formId || !externalId) return null
484+
/**
485+
* A misconfigured source is a failure, not an absent response. Returning
486+
* `null` reads as documented absence, which on an `add` drops the document
487+
* with no counter and no log. `listDocuments` throws on the same condition.
488+
*/
489+
if (!formId) throw new Error('Form ID is required')
490+
if (!externalId) throw new Error('Response ID is required')
485491

486492
const form = await getFormDefinition(accessToken, formId, syncContext)
487493
const fieldTitles = buildFieldTitleMap(form)

apps/sim/connectors/zendesk/zendesk.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,12 @@ export const zendeskConnector: ConnectorConfig = {
532532
externalId: string
533533
): Promise<ExternalDocument | null> => {
534534
const subdomain = (sourceConfig.subdomain as string)?.trim()
535-
if (!subdomain) return null
535+
/**
536+
* A misconfigured source is a failure, not an absent document. Returning
537+
* `null` reads as documented absence, which on an `add` drops the document
538+
* with no counter and no log. `listDocuments` throws on the same condition.
539+
*/
540+
if (!subdomain) throw new Error('Subdomain is required')
536541

537542
try {
538543
const baseUrl = buildBaseUrl(subdomain)

0 commit comments

Comments
 (0)