Skip to content

Commit 1278bce

Browse files
j15zclaude
andcommitted
fix(workflow): recompute search index when the custom-block overlay hydrates
The matches memo resolves tool names through getBlock, so it must carry the overlay version dep like the other getBlock-derived memos; without it, find-in-workflow could index stale custom-block names until an unrelated dep changed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a1c2873 commit 1278bce

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace/workflow-search-replace.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
} from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/float'
3636
import { useCurrentWorkflow } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-current-workflow'
3737
import { getBlock } from '@/blocks'
38+
import { useCustomBlockOverlayVersion } from '@/blocks/custom/client-overlay'
3839
import { useMcpTools } from '@/hooks/mcp/use-mcp-tools'
3940
import { useWorkspaceCredentials } from '@/hooks/queries/credentials'
4041
import { useCustomTools } from '@/hooks/queries/custom-tools'
@@ -213,6 +214,8 @@ export function WorkflowSearchReplace() {
213214
[workspaceCredentials]
214215
)
215216

217+
/** Overlay version invalidates getBlock-resolved tool names in the index. */
218+
const customBlockOverlayVersion = useCustomBlockOverlayVersion()
216219
const matches = useMemo(
217220
() =>
218221
indexWorkflowSearchMatches({
@@ -232,6 +235,7 @@ export function WorkflowSearchReplace() {
232235
[
233236
currentWorkflow.isSnapshotView,
234237
credentialTypeById,
238+
customBlockOverlayVersion,
235239
customTools,
236240
mcpToolNamesById,
237241
query,

0 commit comments

Comments
 (0)