Skip to content

Commit 7897e5e

Browse files
waleedlatif1claude
andcommitted
fix(selectors): prevent unresolved env var templates from leaking into context
- Fall back to undefined instead of raw template string when env var is missing from store, so the null-check in the context loop discards it - Use resolvedDetailId in query cache key so React Query refetches when the underlying env var value changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ebf22ec commit 7897e5e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-selector-setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function useSelectorSetup(
4949
const str = String(value)
5050
if (isEnvVarReference(str)) {
5151
const varName = extractEnvVarName(str)
52-
resolved[key] = envVariables[varName]?.value ?? value
52+
resolved[key] = envVariables[varName]?.value ?? undefined
5353
} else {
5454
resolved[key] = value
5555
}

apps/sim/hooks/selectors/use-selector-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function useSelectorOptionDetail(
5959
const enabled = args.enabled ?? baseEnabled
6060

6161
const query = useQuery<SelectorOption | null>({
62-
queryKey: [...definition.getQueryKey(queryArgs), 'detail', args.detailId ?? 'none'],
62+
queryKey: [...definition.getQueryKey(queryArgs), 'detail', resolvedDetailId ?? 'none'],
6363
queryFn: () => definition.fetchById!(queryArgs),
6464
enabled,
6565
staleTime: definition.staleTime ?? 300_000,

0 commit comments

Comments
 (0)