Add missing include#4
Open
melix99 wants to merge 1 commit into
Open
Conversation
|
👍 This change is also necessary to compile it with clang. |
Tvinck
pushed a commit
to Tvinck/rlottie
that referenced
this pull request
May 22, 2026
КРИТ TelegramMessenger#1: Global JWT auth on /api/* - Fastify onRequest hook in index.ts validates Bearer token for all /api/* - PUBLIC_API_PATHS allowlist: /api/auth/login, /api/auth/register, /api/health, /api/ai/callback (latter uses own secret) КРИТ TelegramMessenger#3: Webhook signature verification - WEBHOOK_SECRET added to Config (required in prod) - kie.ts appends ?token=<secret> to all callBackUrls - POST /api/ai/callback rejects requests without matching token КРИТ TelegramMessenger#4 + ВАЖНО TelegramMessenger#5: WS broadcast + background poller - New src/server/services/aiPoller.ts polls KIE every 10s for processing jobs, updates DB, and broadcasts ai_job:update via WS - ai.ts callback handler now calls broadcastWs() instead of TODO - GET /api/ai/job/:id no longer makes synchronous KIE calls — just reads from DB (poller keeps it fresh) ВАЖНО TelegramMessenger#6: Rate limiting on AI endpoints - @fastify/rate-limit@9 (Fastify 4 compatible) installed - 10 req/min per IP on POST /api/ai/image|video|music|chat - 100 req/min global default on other /api routes ВАЖНО TelegramMessenger#7: SQLite busy_timeout - PRAGMA busy_timeout = 5000 on connection open УЛУЧШИТЬ TelegramMessenger#8: AiToolsPage state preserved across tabs - Zustand store holds image/video/music/chat state per tool - display:none instead of conditional rendering keeps DOM alive УЛУЧШИТЬ #10: Missing indexes - idx_tasks_assignee, idx_ai_jobs_kie, idx_ai_jobs_user - idx_audit_table, idx_audit_user УЛУЧШИТЬ #11: Pagination on list endpoints - GET /api/tasks, /api/employees, /api/finance accept ?limit&offset - Default 100, max 500; response now includes meta: { total, limit, offset } УЛУЧШИТЬ #13: KIE_API_KEY guard - POST /api/ai/* preHandler returns 503 with clear message if key missing useAiJob hook - gcTime: 30min so result survives tab switch - refetchInterval reduced 3s → 8s (poller does the heavy lifting) Tested: - 401 without token on /api/projects ✓ - 401 on /api/ai/callback without secret ✓ - 200 on /api/ai/callback with correct token ✓ - Login → JWT issued ✓ - Pagination meta returned ✓ - 11th AI request → 429 Too Many Requests ✓ https://claude.ai/code/session_019BvFufwnC76DEM3pU2z9eC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the build for me on GCC 11 +.