From ecf6db6cc48ebea6336a3aac4f3e6d0841291247 Mon Sep 17 00:00:00 2001 From: Ronald Arias Date: Fri, 27 Feb 2026 10:58:36 -0500 Subject: [PATCH 1/2] Fix iterateEntities/iterateRelationships not forwarding options The jobState wrapper for iterateEntities and iterateRelationships was dropping the third `options` argument (which includes `concurrency`), so the concurrency setting was silently ignored at runtime. Also adds the `options` parameter to the GraphObjectStore interface in integration-sdk-core to match the existing implementations. Co-Authored-By: Claude Opus 4.6 --- packages/integration-sdk-core/src/types/storage.ts | 8 +++++++- .../integration-sdk-runtime/src/execution/jobState.ts | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/integration-sdk-core/src/types/storage.ts b/packages/integration-sdk-core/src/types/storage.ts index f5bd3e959..50e1a351e 100644 --- a/packages/integration-sdk-core/src/types/storage.ts +++ b/packages/integration-sdk-core/src/types/storage.ts @@ -1,5 +1,9 @@ import { Entity } from './entity'; -import { GraphObjectFilter, GraphObjectIteratee } from './jobState'; +import { + GraphObjectFilter, + GraphObjectIteratee, + GraphObjectIterateeOptions, +} from './jobState'; import { Relationship } from './relationship'; import { GraphObjectIndexMetadata } from '../types/step'; @@ -33,11 +37,13 @@ export interface GraphObjectStore { iterateEntities( filter: GraphObjectFilter, iteratee: GraphObjectIteratee, + options?: GraphObjectIterateeOptions, ): Promise; iterateRelationships( filter: GraphObjectFilter, iteratee: GraphObjectIteratee, + options?: GraphObjectIterateeOptions, ): Promise; flush( diff --git a/packages/integration-sdk-runtime/src/execution/jobState.ts b/packages/integration-sdk-runtime/src/execution/jobState.ts index 4989fe3b6..fff8da141 100644 --- a/packages/integration-sdk-runtime/src/execution/jobState.ts +++ b/packages/integration-sdk-runtime/src/execution/jobState.ts @@ -274,11 +274,11 @@ export function createStepJobState({ return duplicateKeyTracker.hasKey(_key); }, - iterateEntities: (filter, iteratee) => - graphObjectStore.iterateEntities(filter, iteratee), + iterateEntities: (filter, iteratee, options) => + graphObjectStore.iterateEntities(filter, iteratee, options), - iterateRelationships: (filter, iteratee) => - graphObjectStore.iterateRelationships(filter, iteratee), + iterateRelationships: (filter, iteratee, options) => + graphObjectStore.iterateRelationships(filter, iteratee, options), flush: () => graphObjectStore.flush( From e51daed368db95d3d03c4b80760a19109dff4968 Mon Sep 17 00:00:00 2001 From: Ronald Arias Date: Fri, 27 Feb 2026 11:16:39 -0500 Subject: [PATCH 2/2] Fix pre-existing type error in duplicate entity reporting The duplicateKeyTracker changes that removed non-null assertions introduced a type mismatch where createDuplicateEntityReport could return {} but onDuplicateEntityKey expected DuplicateEntityReport. Added a type guard to narrow the type at the call site. Co-Authored-By: Claude Opus 4.6 --- .../src/execution/duplicateKeyTracker.ts | 22 ++++++++++++------- .../src/execution/jobState.ts | 4 +++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/packages/integration-sdk-runtime/src/execution/duplicateKeyTracker.ts b/packages/integration-sdk-runtime/src/execution/duplicateKeyTracker.ts index 227e27d17..037e965f7 100644 --- a/packages/integration-sdk-runtime/src/execution/duplicateKeyTracker.ts +++ b/packages/integration-sdk-runtime/src/execution/duplicateKeyTracker.ts @@ -71,7 +71,7 @@ export async function createDuplicateEntityReport({ payload, indexOfDuplicateKey, graphObjectStore, -}: DuplicateKeyReportParams): Promise { +}: DuplicateKeyReportParams): Promise { const originalEntityFromPayload = getOriginalEntityFromPayload( payload, duplicateEntity._key, @@ -83,10 +83,7 @@ export async function createDuplicateEntityReport({ } else { const originalEntityFromGraphObjectStore = await graphObjectStore.findEntity(duplicateEntity._key); - return compareEntities( - originalEntityFromGraphObjectStore!, - duplicateEntity, - ); + return compareEntities(originalEntityFromGraphObjectStore, duplicateEntity); } } @@ -130,8 +127,8 @@ function isDeepStrictEqual(a: any, b: any): boolean { export type DuplicateEntityReport = { _key: string; - rawDataMatch: boolean; - entityPropertiesMatch: boolean; + rawDataMatch?: boolean; + entityPropertiesMatch?: boolean; rawDataDiff?: string; entityPropertiesDiff?: string; diffErrors?: { rawData?: string; entityProperties?: string }; @@ -233,7 +230,16 @@ export function diffObjects( * @param b * @returns */ -function compareEntities(a: Entity, b: Entity): DuplicateEntityReport { +function compareEntities( + a: Entity | undefined, + b: Entity, +): DuplicateEntityReport { + if (a === undefined) { + return { + _key: b._key, + }; + } + const aClone = JSON.parse(JSON.stringify(a)); const bClone = JSON.parse(JSON.stringify(b)); delete aClone._rawData; diff --git a/packages/integration-sdk-runtime/src/execution/jobState.ts b/packages/integration-sdk-runtime/src/execution/jobState.ts index fff8da141..3b58ce4a4 100644 --- a/packages/integration-sdk-runtime/src/execution/jobState.ts +++ b/packages/integration-sdk-runtime/src/execution/jobState.ts @@ -164,7 +164,9 @@ export function createStepJobState({ indexOfDuplicateKey: index, graphObjectStore, }); - onDuplicateEntityKey(duplicateEntityReport); + if ('_key' in duplicateEntityReport) { + onDuplicateEntityKey(duplicateEntityReport); + } throw err; }