(state: GraphState)
| 70 | * Used to determine if two states are meaningfully different |
| 71 | */ |
| 72 | const computeStateSignature = (state: GraphState): string => { |
| 73 | const normalizedNodes = state.nodes |
| 74 | .map((node) => ({ |
| 75 | id: node.id, |
| 76 | type: node.type, |
| 77 | position: { x: Math.round(node.position.x), y: Math.round(node.position.y) }, |
| 78 | data: { |
| 79 | label: node.data?.label, |
| 80 | componentId: node.data?.componentId, |
| 81 | componentSlug: node.data?.componentSlug, |
| 82 | inputs: node.data?.inputs, |
| 83 | config: node.data?.config, |
| 84 | }, |
| 85 | })) |
| 86 | .sort((a, b) => a.id.localeCompare(b.id)); |
| 87 | |
| 88 | const normalizedEdges = state.edges |
| 89 | .map((edge) => ({ |
| 90 | id: edge.id, |
| 91 | source: edge.source, |
| 92 | target: edge.target, |
| 93 | sourceHandle: edge.sourceHandle, |
| 94 | targetHandle: edge.targetHandle, |
| 95 | })) |
| 96 | .sort((a, b) => a.id.localeCompare(b.id)); |
| 97 | |
| 98 | return JSON.stringify({ nodes: normalizedNodes, edges: normalizedEdges }); |
| 99 | }; |
| 100 | |
| 101 | /** |
| 102 | * Workflow History Store |
no outgoing calls
no test coverage detected