@@ -47,22 +47,10 @@ function isRecord(value: unknown): value is Record<string, unknown> {
4747 return value !== null && typeof value === 'object' && ! Array . isArray ( value )
4848}
4949
50- function isPausedOutputForContext (
51- output : unknown ,
52- stateBlockKey : string ,
53- pauseBlockId : string ,
54- contextId : string
55- ) : boolean {
50+ function isPausedOutputForContext ( output : unknown , contextId : string ) : boolean {
5651 if ( ! isRecord ( output ) ) return false
5752 const metadata = output . _pauseMetadata
58- if ( isRecord ( metadata ) ) {
59- return (
60- metadata . contextId === contextId ||
61- metadata . blockId === stateBlockKey ||
62- metadata . blockId === pauseBlockId
63- )
64- }
65- return false
53+ return isRecord ( metadata ) && metadata . contextId === contextId
6654}
6755
6856function updateResumeOutputInAggregationBuffers (
@@ -76,13 +64,8 @@ function updateResumeOutputInAggregationBuffers(
7664 if ( ! isRecord ( scope ) || ! isRecord ( scope . currentIterationOutputs ) ) continue
7765
7866 const outputs = scope . currentIterationOutputs
79- if (
80- outputs [ stateBlockKey ] !== undefined ||
81- outputs [ pauseBlockId ] !== undefined ||
82- outputs [ contextId ] !== undefined
83- ) {
67+ if ( outputs [ stateBlockKey ] !== undefined || outputs [ pauseBlockId ] !== undefined ) {
8468 delete outputs [ pauseBlockId ]
85- delete outputs [ contextId ]
8669 outputs [ stateBlockKey ] = mergedOutput
8770 }
8871 }
@@ -94,7 +77,7 @@ function updateResumeOutputInAggregationBuffers(
9477 if ( ! Array . isArray ( branchOutputs ) ) continue
9578
9679 const outputIndex = branchOutputs . findIndex ( ( output ) =>
97- isPausedOutputForContext ( output , stateBlockKey , pauseBlockId , contextId )
80+ isPausedOutputForContext ( output , contextId )
9881 )
9982 if ( outputIndex !== - 1 ) {
10083 scope . branchOutputs [ branchIndex ] = [
0 commit comments