Skip to content

Commit f8f033e

Browse files
committed
fix(connectors): address PR review comments
- github: skip blob fetch for empty 0-byte files - salesforce: add fallback message for empty error - zendesk: warn on invalid statusFilter instead of silent fallthrough - evernote: remove dead content.trim() guard
1 parent 1c597dd commit f8f033e

4 files changed

Lines changed: 16 additions & 11 deletions

File tree

apps/sim/connectors/evernote/evernote.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ export const evernoteConnector: ConnectorConfig = {
464464
const plainText = htmlToPlainText(note.content)
465465
const title = note.title || 'Untitled'
466466
const content = plainText.trim() ? plainText : title
467-
if (!content.trim()) return null
468467

469468
const shardId = extractShardId(accessToken)
470469
const userId = extractUserId(accessToken)

apps/sim/connectors/github/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export const githubConnector: ConnectorConfig = {
312312
let content: string
313313
if (encoding === 'base64' && rawContent.length > 0) {
314314
content = Buffer.from(rawContent, 'base64').toString('utf8')
315-
} else if ((encoding === 'none' || rawContent.length === 0) && data.sha) {
315+
} else if (encoding === 'none' && data.sha && size > 0) {
316316
content = await fetchBlobContent(accessToken, owner, repo, data.sha as string)
317317
} else {
318318
content = ''

apps/sim/connectors/salesforce/salesforce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export const salesforceConnector: ConnectorConfig = {
479479

480480
return { valid: true }
481481
} catch (error) {
482-
return { valid: false, error: toError(error).message }
482+
return { valid: false, error: toError(error).message || 'Failed to validate configuration' }
483483
}
484484
},
485485

apps/sim/connectors/zendesk/zendesk.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,23 @@ async function fetchTickets(
134134
const limit = maxTickets || DEFAULT_MAX_TICKETS
135135
let url: string | null = `${baseUrl}/api/v2/tickets.json?per_page=${TICKETS_PER_PAGE}`
136136

137-
if (statusFilter && statusFilter !== 'all' && VALID_TICKET_STATUSES.has(statusFilter)) {
138-
if (limit > SEARCH_API_RESULT_CAP) {
137+
if (statusFilter && statusFilter !== 'all') {
138+
if (VALID_TICKET_STATUSES.has(statusFilter)) {
139+
if (limit > SEARCH_API_RESULT_CAP) {
140+
logger.warn(
141+
`Zendesk Search API caps at ${SEARCH_API_RESULT_CAP} results; requested limit ${limit} will be truncated. Remove status filter to use the unbounded tickets endpoint.`
142+
)
143+
}
144+
const params = new URLSearchParams({
145+
query: `type:ticket status:${statusFilter}`,
146+
per_page: String(TICKETS_PER_PAGE),
147+
})
148+
url = `${baseUrl}/api/v2/search.json?${params.toString()}`
149+
} else {
139150
logger.warn(
140-
`Zendesk Search API caps at ${SEARCH_API_RESULT_CAP} results; requested limit ${limit} will be truncated. Remove status filter to use the unbounded tickets endpoint.`
151+
`Invalid Zendesk statusFilter "${statusFilter}"; falling back to all tickets. Valid values: ${[...VALID_TICKET_STATUSES].join(', ')}.`
141152
)
142153
}
143-
const params = new URLSearchParams({
144-
query: `type:ticket status:${statusFilter}`,
145-
per_page: String(TICKETS_PER_PAGE),
146-
})
147-
url = `${baseUrl}/api/v2/search.json?${params.toString()}`
148154
}
149155

150156
while (url && allTickets.length < limit) {

0 commit comments

Comments
 (0)