@@ -766,7 +766,9 @@ function relocate(served: any, secret?: string) {
766766 config : { triggerType : 'api' , hookId : 'intake' , ...( secret !== undefined ? { secret } : { } ) } ,
767767 } ,
768768 ] ,
769- edges : [ { id : 'e1' , source : 'begin_v2' , target : 'finish' } ] ,
769+ // `e2` keeps the old start node reached: a node no edge reaches is
770+ // refused at parse, which is not the refusal these tests are about.
771+ edges : [ { id : 'e1' , source : 'begin_v2' , target : 'finish' } , { id : 'e2' , source : 'begin_v2' , target : 'begin' } ] ,
770772 } ;
771773}
772774
@@ -906,7 +908,8 @@ function storedCalloutFlow() {
906908 } ,
907909 } ,
908910 ] ,
909- edges : [ ] ,
911+ // Wired: a top-level node no edge reaches is refused at parse.
912+ edges : [ { id : 's1' , source : 'begin' , target : 'each' } , { id : 's2' , source : 'each' , target : 'fan' } ] ,
910913 } ;
911914}
912915
@@ -1042,6 +1045,7 @@ function storedMovesFlow() {
10421045 const flow : any = storedCalloutFlow ( ) ;
10431046 flow . name = 'moves' ;
10441047 flow . nodes . push ( { id : 'call' , type : 'http' , label : 'Call' , config : { url : 'https://c' , durable : true , signingSecret : SIGNING } } ) ;
1048+ flow . edges . push ( { id : 's3' , source : 'fan' , target : 'call' } ) ;
10451049 return flow ;
10461050}
10471051
@@ -1054,6 +1058,7 @@ function movedOutOfLoop(served: any) {
10541058 return {
10551059 ...served ,
10561060 nodes : [ begin , { ...each , config : { ...each . config , body : { nodes : [ NOOP ( 'body_noop' ) ] , edges : [ ] } } } , fan , call , perRow ] ,
1061+ edges : [ ...served . edges , { id : 's4' , source : 'call' , target : perRow . id } ] ,
10571062 } ;
10581063}
10591064
@@ -1178,7 +1183,7 @@ describe('#20590 round 2 — the relocation counts nodes, not every object carry
11781183 const stored = storedMovesFlow ( ) ;
11791184 const incoming = movedWithEdgeTwin ( redactMetadataItem ( 'flow' , stored ) ) ;
11801185 const out : any = carryForwardRedactedValues ( 'flow' , incoming , stored ) ;
1181- expect ( out . edges . map ( ( e : any ) => e . id ) ) . toEqual ( [ 'per_row' ] ) ;
1186+ expect ( out . edges . map ( ( e : any ) => e . id ) ) . toEqual ( [ 's1' , 's2' , 's3' , 's4' , ' per_row'] ) ;
11821187 expect ( out . nodes [ 4 ] . id ) . toBe ( 'per_row' ) ;
11831188 expect ( out . nodes [ 4 ] . config . signingSecret ) . toBe ( SIGNING ) ;
11841189 expect ( allStrings ( redactMetadataItem ( 'flow' , out ) ) ) . not . toContain ( SIGNING ) ;
@@ -1197,7 +1202,7 @@ describe('#20590 round 2 — the relocation counts nodes, not every object carry
11971202 await protocol . saveMetaItem ( { type : 'flow' , name : 'moves' , item : movedWithEdgeTwin ( editable ) } ) ;
11981203
11991204 const at = JSON . parse ( Array . from ( rows . values ( ) ) . find ( ( r ) => r . name === 'moves' && r . state === 'active' ) ! . metadata ) ;
1200- expect ( at . edges . map ( ( e : any ) => e . id ) ) . toEqual ( [ 'per_row' ] ) ;
1205+ expect ( at . edges . map ( ( e : any ) => e . id ) ) . toEqual ( [ 's1' , 's2' , 's3' , 's4' , ' per_row'] ) ;
12011206 expect ( at . nodes [ 4 ] . config . signingSecret ) . toBe ( SIGNING ) ;
12021207 expect ( allStrings ( await protocol . getMetaItem ( { type : 'flow' , name : 'moves' } ) ) ) . not . toContain ( SIGNING ) ;
12031208 } ) ;
0 commit comments