Skip to content

Add missing include#4

Open
melix99 wants to merge 1 commit into
TelegramMessenger:masterfrom
paper-plane-developers:fix-build
Open

Add missing include#4
melix99 wants to merge 1 commit into
TelegramMessenger:masterfrom
paper-plane-developers:fix-build

Conversation

@melix99
Copy link
Copy Markdown

@melix99 melix99 commented Sep 14, 2022

This fixes the build for me on GCC 11 +.

@msrd0
Copy link
Copy Markdown

msrd0 commented Oct 27, 2022

👍 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants