Skip to content

Commit 267c00d

Browse files
committed
fix(connectors): docusign sandbox source URL, greenhouse scorecard cap, gong overlap; add incident.io status/mode filters
1 parent 0326219 commit 267c00d

4 files changed

Lines changed: 67 additions & 7 deletions

File tree

apps/sim/connectors/docusign/docusign.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ const logger = createLogger('DocuSignConnector')
1515
*/
1616
const DOCUSIGN_USERINFO_URL = 'https://account-d.docusign.com/oauth/userinfo'
1717

18+
/**
19+
* DocuSign web-app base for envelope deep links. MUST match the same environment as
20+
* {@link DOCUSIGN_USERINFO_URL}: demo/sandbox envelopes only exist in the demo web app
21+
* (`appdemo.docusign.com`), not production (`app.docusign.com`). Keep these in lockstep
22+
* if the OAuth environment ever changes.
23+
*/
24+
const DOCUSIGN_WEB_BASE = 'https://appdemo.docusign.com'
25+
1826
const DEFAULT_LOOKBACK_DAYS = 90
1927
const MAX_PAGE_SIZE = 100
2028
const DEFAULT_MAX_ENVELOPES = 0
@@ -219,7 +227,7 @@ function buildContentHash(envelope: DocuSignEnvelope): string {
219227
*/
220228
function buildSourceUrl(envelopeId: string | undefined): string | undefined {
221229
if (!envelopeId) return undefined
222-
return `https://app.docusign.com/documents/details/${envelopeId}`
230+
return `${DOCUSIGN_WEB_BASE}/documents/details/${envelopeId}`
223231
}
224232

225233
/**

apps/sim/connectors/gong/gong.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ const DEFAULT_LOOKBACK_DAYS = 90
1212
const MAX_LOOKBACK_DAYS = 180
1313
/**
1414
* Days of overlap added when computing the incremental sync window. Gong call data
15-
* (parties, transcript) can finish processing minutes to hours after a call ends.
16-
* A small overlap re-checks recently-ended calls so late-arriving transcripts are
17-
* not missed, at the cost of re-listing a few already-synced calls (which are
18-
* skipped downstream when their content hash is unchanged).
15+
* (parties, transcript) can finish processing minutes to hours — occasionally a
16+
* day or two — after a call ends. The sync engine re-attempts calls whose
17+
* transcript was not yet ready (a null getDocument result is never persisted, so
18+
* the call is re-listed and re-fetched on the next sync), but only while the call
19+
* stays inside the incremental window. A two-week overlap keeps recently-ended
20+
* calls in that window long enough for late transcripts to be picked up, at the
21+
* cost of re-listing already-synced calls (skipped downstream by content hash).
1922
*/
20-
const INCREMENTAL_OVERLAP_DAYS = 2
23+
const INCREMENTAL_OVERLAP_DAYS = 14
2124
const MS_PER_DAY = 24 * 60 * 60 * 1000
2225

2326
/**

apps/sim/connectors/greenhouse/greenhouse.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ const logger = createLogger('GreenhouseConnector')
99

1010
const GREENHOUSE_API_BASE = 'https://harvest.greenhouse.io/v1'
1111

12+
/**
13+
* Upper bound on per-application scorecard requests during a single getDocument call.
14+
* A candidate can have many applications (e.g. internal-transfer tracking); without a
15+
* cap, one document fetch could fan out into dozens of sequential requests. Mirrors the
16+
* Ashby connector's MAX_APPLICATIONS_FOR_FEEDBACK bound.
17+
*/
18+
const MAX_APPLICATIONS_FOR_SCORECARDS = 10
19+
1220
/**
1321
* Greenhouse Harvest allows up to 500 candidates per page. We page through the
1422
* full list using the `page` query parameter and stop when the `Link` response
@@ -436,7 +444,7 @@ async function fetchScorecards(
436444
): Promise<GreenhouseScorecard[]> {
437445
const all: GreenhouseScorecard[] = []
438446

439-
for (const applicationId of applicationIds) {
447+
for (const applicationId of applicationIds.slice(0, MAX_APPLICATIONS_FOR_SCORECARDS)) {
440448
try {
441449
const response = await fetchWithRetry(
442450
`${GREENHOUSE_API_BASE}/applications/${applicationId}/scorecards`,

apps/sim/connectors/incidentio/incidentio.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,41 @@ export const incidentioConnector: ConnectorConfig = {
369369
supportsIncrementalSync: true,
370370

371371
configFields: [
372+
{
373+
id: 'statusCategory',
374+
title: 'Status Category',
375+
type: 'dropdown',
376+
required: false,
377+
mode: 'advanced',
378+
options: [
379+
{ label: 'All', id: '' },
380+
{ label: 'Live (active)', id: 'live' },
381+
{ label: 'Closed', id: 'closed' },
382+
{ label: 'Triage', id: 'triage' },
383+
{ label: 'Learning (post-incident)', id: 'learning' },
384+
{ label: 'Declined', id: 'declined' },
385+
{ label: 'Merged', id: 'merged' },
386+
{ label: 'Canceled', id: 'canceled' },
387+
],
388+
description:
389+
'Only sync incidents in this status category. Leave as All to sync every category.',
390+
},
391+
{
392+
id: 'mode',
393+
title: 'Mode',
394+
type: 'dropdown',
395+
required: false,
396+
mode: 'advanced',
397+
options: [
398+
{ label: 'All', id: '' },
399+
{ label: 'Standard (real incidents)', id: 'standard' },
400+
{ label: 'Retrospective', id: 'retrospective' },
401+
{ label: 'Test', id: 'test' },
402+
{ label: 'Tutorial', id: 'tutorial' },
403+
],
404+
description:
405+
'Only sync incidents of this mode. Use Standard to exclude test/tutorial incidents.',
406+
},
372407
{
373408
id: 'maxIncidents',
374409
title: 'Max Incidents',
@@ -388,11 +423,17 @@ export const incidentioConnector: ConnectorConfig = {
388423
): Promise<ExternalDocumentList> => {
389424
const maxIncidents = sourceConfig.maxIncidents ? Number(sourceConfig.maxIncidents) : 0
390425

426+
const statusCategory =
427+
typeof sourceConfig.statusCategory === 'string' ? sourceConfig.statusCategory.trim() : ''
428+
const mode = typeof sourceConfig.mode === 'string' ? sourceConfig.mode.trim() : ''
429+
391430
const url = new URL(`${INCIDENTIO_API_BASE}/v2/incidents`)
392431
url.searchParams.set('page_size', String(PAGE_SIZE))
393432
url.searchParams.set('sort_by', 'created_at_oldest_first')
394433
if (cursor) url.searchParams.set('after', cursor)
395434
if (lastSyncAt) url.searchParams.set('updated_at[gte]', lastSyncAt.toISOString())
435+
if (statusCategory) url.searchParams.set('status_category[one_of]', statusCategory)
436+
if (mode) url.searchParams.set('mode[one_of]', mode)
396437

397438
logger.info('Listing incident.io incidents', {
398439
cursor: cursor ?? 'initial',

0 commit comments

Comments
 (0)