Skip to content

Commit f9a4415

Browse files
committed
fix
1 parent b2e0ff7 commit f9a4415

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/sim/hooks/use-collaborative-workflow.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ export function useCollaborativeWorkflow() {
804804
)
805805

806806
const collaborativeSetSubblockValue = useCallback(
807-
(blockId: string, subblockId: string, value: any) => {
807+
(blockId: string, subblockId: string, value: any, options?: { _visited?: Set<string> }) => {
808808
if (isApplyingRemoteChange.current) return
809809

810810
// Skip socket operations when in diff mode
@@ -843,6 +843,9 @@ export function useCollaborativeWorkflow() {
843843

844844
// Declarative clearing: clear sub-blocks that depend on this subblockId
845845
try {
846+
const visited = options?._visited || new Set<string>()
847+
if (visited.has(subblockId)) return
848+
visited.add(subblockId)
846849
const blockType = useWorkflowStore.getState().blocks?.[blockId]?.type
847850
const blockConfig = blockType ? getBlock(blockType) : null
848851
if (blockConfig?.subBlocks && Array.isArray(blockConfig.subBlocks)) {
@@ -852,7 +855,8 @@ export function useCollaborativeWorkflow() {
852855
for (const dep of dependents) {
853856
// Skip clearing if the dependent is the same field
854857
if (!dep?.id || dep.id === subblockId) continue
855-
subBlockStore.setValue(blockId, dep.id, '')
858+
// Cascade using the same collaborative path so it emits and further cascades
859+
collaborativeSetSubblockValue(blockId, dep.id, '', { _visited: visited })
856860
}
857861
}
858862
} catch {

0 commit comments

Comments
 (0)