Skip to content

Commit dc711cb

Browse files
committed
fix(connectors): grain cache filter window across pages, greenhouse guard NaN page, rootly skip empty incidents
1 parent 90b45b7 commit dc711cb

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

apps/sim/connectors/grain/grain.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ export const grainConnector: ConnectorConfig = {
376376
const body: Record<string, unknown> = { include: RECORDING_INCLUDE }
377377
if (cursor) body.cursor = cursor
378378

379-
const filter = buildRecordingFilter(sourceConfig)
379+
const cachedFilter = syncContext?.grainFilter as Record<string, unknown> | undefined | null
380+
const filter = cachedFilter !== undefined ? cachedFilter : buildRecordingFilter(sourceConfig)
381+
if (syncContext && cachedFilter === undefined) syncContext.grainFilter = filter ?? null
380382
if (filter) body.filter = filter
381383

382384
logger.info('Listing Grain recordings', {

apps/sim/connectors/greenhouse/greenhouse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ export const greenhouseConnector: ConnectorConfig = {
537537
lastSyncAt?: Date
538538
): Promise<ExternalDocumentList> => {
539539
const maxCandidates = sourceConfig.maxCandidates ? Number(sourceConfig.maxCandidates) : 0
540-
const page = cursor ? Number(cursor) : 1
540+
const parsedPage = cursor ? Number(cursor) : 1
541+
const page = Number.isFinite(parsedPage) && parsedPage > 0 ? Math.floor(parsedPage) : 1
541542
const updatedAfter = computeUpdatedAfter(lastSyncAt)
542543
const jobId = typeof sourceConfig.jobId === 'string' ? sourceConfig.jobId.trim() : ''
543544
const createdAfter =

apps/sim/connectors/rootly/rootly.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ export const rootlyConnector: ConnectorConfig = {
509509

510510
const events = await fetchTimelineEvents(accessToken, id)
511511
const content = formatIncidentContent(attrs, events)
512+
if (!content.trim()) {
513+
logger.info('Skipping Rootly incident with no indexable content', { externalId: id })
514+
return null
515+
}
512516
const metadata = buildMetadata(attrs)
513517

514518
return {

0 commit comments

Comments
 (0)