chore(ci+logs): eslint в CI, npm audit, logger с уровнями, retention error_logs

Шаги 1.6 и 1.7 плана production-готовности:
- eslint flat-config (баг-ловушки, легаси warn), lint блокирующий в pr-check
- npm audit --audit-level=high в CI (отчёт)
- фикс реального бага: условный useRef в TaskTitleInline
- server/utils/logger.ts (LOG_LEVEL/LOG_FORMAT) в 5 горячих местах
- error_logs retention 30 дней (worker), redactSensitive в captureErrorLog
- 0 errors lint, vitest 96/96
This commit is contained in:
2026-09-08 00:11:38 +03:00
parent 6eaca79cc6
commit abd5d4b65f
14 changed files with 1579 additions and 19 deletions

View File

@@ -7,6 +7,9 @@ import { formatUserName } from '../utils/formatUserName';
import { tasks, forms, roles } from '@shared/schema';
import { eq, and, inArray } from 'drizzle-orm';
import { SseConnectionIndex } from '../utils/sse-connection-index';
import { logger } from '../utils/logger';
const sseLog = logger('sse');
// ── Rate-limit helpers ───────────────────────────────────────────────────────
// In offices with a single public IP and many users, IP-only rate limiting
@@ -151,7 +154,7 @@ export class EventBus {
}
return true;
} catch (error) {
console.error(`Failed to send event to connection ${connection.id}:`, error);
sseLog.error(`Failed to send event to connection ${connection.id}:`, error);
this.removeConnection(connection.id);
return false;
}