File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
app/api/workflows/[id]/state Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ const BlockDataSchema = z.object({
3333 doWhileCondition : z . string ( ) . optional ( ) ,
3434 parallelType : z . enum ( [ 'collection' , 'count' ] ) . optional ( ) ,
3535 type : z . string ( ) . optional ( ) ,
36+ canonicalModes : z . record ( z . enum ( [ 'basic' , 'advanced' ] ) ) . optional ( ) ,
3637} )
3738
3839const SubBlockStateSchema = z . object ( {
Original file line number Diff line number Diff line change @@ -897,6 +897,17 @@ export function useCollaborativeWorkflow() {
897897 // Collect all edge IDs to remove
898898 const edgeIdsToRemove = updates . flatMap ( ( u ) => u . affectedEdges . map ( ( e ) => e . id ) )
899899 if ( edgeIdsToRemove . length > 0 ) {
900+ const edgeOperationId = crypto . randomUUID ( )
901+ addToQueue ( {
902+ id : edgeOperationId ,
903+ operation : {
904+ operation : EDGES_OPERATIONS . BATCH_REMOVE_EDGES ,
905+ target : OPERATION_TARGETS . EDGES ,
906+ payload : { ids : edgeIdsToRemove } ,
907+ } ,
908+ workflowId : activeWorkflowId || '' ,
909+ userId : session ?. user ?. id || 'unknown' ,
910+ } )
900911 useWorkflowStore . getState ( ) . batchRemoveEdges ( edgeIdsToRemove )
901912 }
902913
Original file line number Diff line number Diff line change @@ -337,10 +337,11 @@ async function handleBlockOperationTx(
337337 const currentData = currentBlock ?. data || { }
338338
339339 // Update data with parentId and extent
340+ const { parentId : _removedParentId , extent : _removedExtent , ...restData } = currentData
340341 const updatedData = isRemovingFromParent
341- ? { } // Clear data entirely when removing from parent
342+ ? restData
342343 : {
343- ...currentData ,
344+ ...restData ,
344345 ...( payload . parentId ? { parentId : payload . parentId } : { } ) ,
345346 ...( payload . extent ? { extent : payload . extent } : { } ) ,
346347 }
@@ -828,10 +829,11 @@ async function handleBlocksOperationTx(
828829
829830 const currentData = currentBlock ?. data || { }
830831
832+ const { parentId : _removedParentId , extent : _removedExtent , ...restData } = currentData
831833 const updatedData = isRemovingFromParent
832- ? { }
834+ ? restData
833835 : {
834- ...currentData ,
836+ ...restData ,
835837 ...( parentId ? { parentId, extent : 'parent' } : { } ) ,
836838 }
837839
You can’t perform that action at this time.
0 commit comments