Skip to content

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

fix: integration bot deactive resolved and redis type error

Akhil Mohan750c1b46da2a
diff --git a/backend/src/services/RedisService.ts b/backend/src/services/RedisService.ts
index a6ae5b0269..23f945bb7f 100644
--- a/backend/src/services/RedisService.ts
+++ b/backend/src/services/RedisService.ts
@@ -1,12 +1,12 @@
-import { Redis } from "ioredis"
+import Redis, { Redis as TRedis } from "ioredis";
-let redisClient: Redis | null;
+let redisClient: TRedis | null;
if (process.env.REDIS_URL) {
redisClient = new Redis(process.env.REDIS_URL as string);
} else {
console.warn("Redis URL not set, skipping Redis initialization.");
- redisClient = null
+ redisClient = null;
}
-export { redisClient }
\ No newline at end of file
+export { redisClient };
diff --git a/backend/src/validation/secrets.ts b/backend/src/validation/secrets.ts
index cc541ab9ec..28e7f469dd 100644
--- a/backend/src/validation/secrets.ts
+++ b/backend/src/validation/secrets.ts
@@ -270,7 +270,6 @@ export const UpdateSecretByNameRawV3 = z.object({
workspaceId: z.string().trim(),
environment: z.string().trim(),
secretValue: z.string().trim(),
- secretName: z.string().trim(),
secretPath: z.string().trim().default("/"),
type: z.enum([SECRET_SHARED, SECRET_PERSONAL]).default(SECRET_SHARED)
})
diff --git a/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx b/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx
index 0f2f8a97d7..8a2ae014b4 100644
--- a/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx
+++ b/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx
@@ -51,17 +51,20 @@ export const IntegrationsPage = withProjectPermission(
const { data: cloudIntegrations, isLoading: isCloudIntegrationsLoading } =
useGetCloudIntegrations();
- const { data: integrationAuths, isLoading: isIntegrationAuthLoading } =
- useGetWorkspaceAuthorizations(
- workspaceId,
- useCallback((data: IntegrationAuth[]) => {
- const groupBy: Record<string, IntegrationAuth> = {};
- data.forEach((el) => {
- groupBy[el.integration] = el;
- });
- return groupBy;
- }, [])
- );
+ const {
+ data: integrationAuths,
+ isLoading: isIntegrationAuthLoading,
+ isFetching: isIntegrationAuthFetching
+ } = useGetWorkspaceAuthorizations(
+ workspaceId,
+ useCallback((data: IntegrationAuth[]) => {
+ const groupBy: Record<string, IntegrationAuth> = {};
+ data.forEach((el) => {
+ groupBy[el.integration] = el;
+ });
+ return groupBy;
+ }, [])
+ );
// mutation
const {
data: integrations,
@@ -77,18 +80,18 @@ export const IntegrationsPage = withProjectPermission(
const { mutateAsync: deleteIntegration } = useDeleteIntegration();
const {
mutateAsync: deleteIntegrationAuth,
- isLoading: isDeleteIntegrationAuthSuccess,
+ isSuccess: isDeleteIntegrationAuthSuccess,
reset: resetDeleteIntegrationAuth
} = useDeleteIntegrationAuth();
// summary: this use effect is trigger when all integration auths are removed thus deactivate bot
- // details: so onsuccessfully deleting an integration auth, immediately integration list is refeteched
- // After the refetch is completed check if its empty. Then set bot active and reset the submit hook
+ // details: so on successfully deleting an integration auth, immediately integration list is refeteched
+ // After the refetch is completed check if its empty. Then set bot active and reset the submit hook for isSuccess to go back to false
useEffect(() => {
if (
isDeleteIntegrationAuthSuccess &&
!isIntegrationFetching &&
- !isIntegrationAuthLoading &&
+ !isIntegrationAuthFetching &&
!integrations?.length &&
!integrationAuths?.length
) {
@@ -103,7 +106,7 @@ export const IntegrationsPage = withProjectPermission(
}, [
isIntegrationFetching,
isDeleteIntegrationAuthSuccess,
- isIntegrationAuthLoading,
+ isIntegrationAuthFetching,
integrationAuths?.length,
integrations?.length
]);