fix(audit): sécurité + perf + DB — 40 problèmes adressés
SÉCURITÉ (CRITIQUE): - link-preview: auth() obligatoire + filtre IP privées (SSRF fix) - metrics: !metricsToken → 401 au lieu d'etre ouvert si token absent - contextual-ai-chat: DOMPurify.sanitize() sur dangerouslySetInnerHTML (XSS fix) PERFORMANCE: - graph/route.ts: take:500 + orderBy updatedAt desc (pas de full table scan) - syncAllEmbeddings: batch parallèle Promise.allSettled × 5 (pas séquentiel) - 80 console.log supprimés du code production BASE DE DONNÉES: - Note: index contentUpdatedAt + isPublic ajoutés au schema - DocumentChunk: commentaire index vectoriel HNSW (à exécuter manuellement)
This commit is contained in:
@@ -205,7 +205,6 @@ export async function executeNotebookOrganization(plan: OrganizationPlan): Promi
|
||||
})
|
||||
if (!notebook) return { success: false, created: 0, moved: 0, error: 'Carnet introuvable' }
|
||||
|
||||
console.log('[organize-notebook] Executing plan:', JSON.stringify({
|
||||
notebookId: plan.notebookId,
|
||||
groups: plan.groups.map(g => ({ name: g.name, isNew: g.isNew, existingId: g.existingId, noteCount: g.notes.length }))
|
||||
}))
|
||||
@@ -254,7 +253,6 @@ export async function executeNotebookOrganization(plan: OrganizationPlan): Promi
|
||||
userId: session.user.id,
|
||||
},
|
||||
})
|
||||
console.log(`[organize-notebook] Created sub-notebook "${newSub.name}" (id: ${newSub.id}) under ${plan.notebookId}`)
|
||||
targetNotebookId = newSub.id
|
||||
created++
|
||||
}
|
||||
@@ -269,7 +267,6 @@ export async function executeNotebookOrganization(plan: OrganizationPlan): Promi
|
||||
},
|
||||
data: { notebookId: targetNotebookId },
|
||||
})
|
||||
console.log(`[organize-notebook] Moved ${result.count} notes to "${group.name}"`)
|
||||
moved += result.count
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user