Skip to content

Commit f7404a3

Browse files
committed
chore(block-path-calculator): remove unused calculateAccessibleBlocksForWorkflow method
1 parent 0c261f7 commit f7404a3

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

apps/sim/lib/workflows/blocks/block-path-calculator.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { SerializedWorkflow } from '@/serializer/types'
2-
31
/**
42
* Shared utility for calculating block paths and accessible connections.
53
* Used by both frontend (useBlockConnections) and backend (InputResolver) to ensure consistency.
@@ -65,36 +63,4 @@ export class BlockPathCalculator {
6563

6664
return Array.from(pathNodes)
6765
}
68-
69-
/**
70-
* Calculates accessible blocks for all blocks in a workflow.
71-
* This ensures consistent block reference resolution across frontend and backend.
72-
*
73-
* @param workflow - The serialized workflow
74-
* @returns Map of block ID to Set of accessible block IDs
75-
*/
76-
static calculateAccessibleBlocksForWorkflow(
77-
workflow: SerializedWorkflow
78-
): Map<string, Set<string>> {
79-
const accessibleMap = new Map<string, Set<string>>()
80-
81-
for (const block of workflow.blocks) {
82-
const accessibleBlocks = new Set<string>()
83-
84-
// Find all blocks along paths leading to this block
85-
const pathNodes = BlockPathCalculator.findAllPathNodes(workflow.connections, block.id)
86-
pathNodes.forEach((nodeId) => accessibleBlocks.add(nodeId))
87-
88-
// Only add starter block if it's actually upstream (already in pathNodes)
89-
// Don't add it just because it exists on the canvas
90-
const starterBlock = workflow.blocks.find((b) => b.metadata?.id === 'starter')
91-
if (starterBlock && starterBlock.id !== block.id && pathNodes.includes(starterBlock.id)) {
92-
accessibleBlocks.add(starterBlock.id)
93-
}
94-
95-
accessibleMap.set(block.id, accessibleBlocks)
96-
}
97-
98-
return accessibleMap
99-
}
10066
}

0 commit comments

Comments
 (0)