Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: invalidate ref tree query on batch edit

Scott Wilson0c0ec4f63e8d
diff --git a/frontend/src/hooks/api/secrets/mutations.tsx b/frontend/src/hooks/api/secrets/mutations.tsx
index 6864ab61b1..3ba83c223b 100644
--- a/frontend/src/hooks/api/secrets/mutations.tsx
+++ b/frontend/src/hooks/api/secrets/mutations.tsx
@@ -578,6 +578,11 @@ export const useCreateCommit = () => {
queryClient.invalidateQueries({
queryKey: secretKeys.getProjectSecret({ projectId, environment, secretPath })
});
+ queryClient.invalidateQueries({
+ predicate: (query) =>
+ query.queryKey[0] === "secret-reference-tree" &&
+ (query.queryKey[1] as { projectId?: string })?.projectId === projectId
+ });
queryClient.invalidateQueries({
queryKey: secretSnapshotKeys.list({ environment, projectId, directory: secretPath })
});