Skip to content

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

Fix AI review feedbacks

Fang-Pen Lineed5db7672e7
diff --git a/backend/src/db/schemas/audit-logs.ts b/backend/src/db/schemas/audit-logs.ts
index d1c239724c..6f3e8b3261 100644
--- a/backend/src/db/schemas/audit-logs.ts
+++ b/backend/src/db/schemas/audit-logs.ts
@@ -25,5 +25,5 @@ export const AuditLogsSchema = z.object({
});
export type TAuditLogs = z.infer<typeof AuditLogsSchema>;
-export type TAuditLogsInsert = Omit<z.input<typeof AuditLogsSchema>, TImmutableDBKeys>;
+export type TAuditLogsInsert = Omit<z.input<typeof AuditLogsSchema>, TImmutableDBKeys> & { id: string };
export type TAuditLogsUpdate = Partial<Omit<z.input<typeof AuditLogsSchema>, TImmutableDBKeys>>;
diff --git a/backend/src/ee/services/audit-log/audit-log-queue.ts b/backend/src/ee/services/audit-log/audit-log-queue.ts
index a2775a636e..cfb98d8363 100644
--- a/backend/src/ee/services/audit-log/audit-log-queue.ts
+++ b/backend/src/ee/services/audit-log/audit-log-queue.ts
@@ -80,8 +80,9 @@ export const auditLogQueueServiceFactory = async ({
const auditLogId = randomUUID();
const results = await Promise.allSettled([
- async () => {
+ (async () => {
const auditLog = await auditLogDAL.create({
+ id: auditLogId,
actor: actor.type,
actorMetadata: actor.metadata,
userAgent,
@@ -94,8 +95,8 @@ export const auditLogQueueServiceFactory = async ({
eventMetadata: event.metadata,
userAgentType
});
- await auditLogStreamService.streamLog(orgId!, auditLog);
- },
+ await auditLogStreamService.streamLog(orgId, auditLog);
+ })(),
...(clickhouseClient && CLICKHOUSE_AUDIT_LOG_ENABLED
? [
clickhouseClient.insert({