Skip to content

Commit cfc8e71

Browse files
committed
fix(ashby): eliminate double-logging, fix hiringTeam JSDoc
- Remove pre-throw warn/error logs; catch block is single logging point - Remove hiringTeam from candidateHire JSDoc (TriggerOutput doesn't support arrays)
1 parent b0bedcb commit cfc8e71

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,18 +2172,12 @@ export async function createAshbyWebhookSubscription(
21722172
const { apiKey, triggerId } = providerConfig || {}
21732173

21742174
if (!apiKey) {
2175-
ashbyLogger.warn(`[${requestId}] Missing apiKey for Ashby webhook creation.`, {
2176-
webhookId: webhookData.id,
2177-
})
21782175
throw new Error(
21792176
'Ashby API Key is required. Please provide your API Key with apiKeysWrite permission in the trigger configuration.'
21802177
)
21812178
}
21822179

21832180
if (!triggerId) {
2184-
ashbyLogger.warn(`[${requestId}] Missing triggerId for Ashby webhook creation.`, {
2185-
webhookId: webhookData.id,
2186-
})
21872181
throw new Error('Trigger ID is required to create Ashby webhook.')
21882182
}
21892183

@@ -2229,10 +2223,6 @@ export async function createAshbyWebhookSubscription(
22292223
if (!ashbyResponse.ok || !responseBody.success) {
22302224
const errorMessage =
22312225
responseBody.errorInfo?.message || responseBody.message || 'Unknown Ashby API error'
2232-
ashbyLogger.error(
2233-
`[${requestId}] Failed to create webhook in Ashby for webhook ${webhookData.id}. Status: ${ashbyResponse.status}`,
2234-
{ message: errorMessage, response: responseBody }
2235-
)
22362226

22372227
let userFriendlyMessage = 'Failed to create webhook subscription in Ashby'
22382228
if (ashbyResponse.status === 401) {
@@ -2250,10 +2240,6 @@ export async function createAshbyWebhookSubscription(
22502240

22512241
const externalId = responseBody.results?.id
22522242
if (!externalId) {
2253-
ashbyLogger.error(
2254-
`[${requestId}] Ashby webhook created but no ID returned for webhook ${webhookData.id}`,
2255-
{ response: responseBody }
2256-
)
22572243
throw new Error('Ashby webhook creation succeeded but no webhook ID was returned')
22582244
}
22592245

apps/sim/triggers/ashby/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ export function buildCandidateStageChangeOutputs(): Record<string, TriggerOutput
140140
/**
141141
* Build outputs for candidateHire events.
142142
* Payload: { action, data: { application: { id, createdAt, updatedAt, status,
143-
* candidate: { id, name }, currentInterviewStage: { id, title, type },
144-
* job: { id, title }, hiringTeam: [...] } } }
143+
* candidate: { id, name }, currentInterviewStage: { id, title },
144+
* job: { id, title } } } }
145145
*/
146146
export function buildCandidateHireOutputs(): Record<string, TriggerOutput> {
147147
return {

0 commit comments

Comments
 (0)