Commit graph

12 commits

Author SHA1 Message Date
rever-tecnologia
3a37892864 refactor(convex): replace collect() with take() to prevent OOM
- liveChat.ts: limit sessions/messages queries (take 50-500)
- tickets.ts: batch delete operations, limit playNext/reassign (take 100-2000)
- reports.ts: limit ticket/user/machine queries (take 500-2000)
- machines.ts: limit machine queries for registration/listing (take 500)
- metrics.ts: limit device health summary (take 200)
- users.ts: limit user search in claimInvite (take 5000)
- alerts.ts: limit company/alert queries (take 500-1000)
- migrations.ts: limit batch operations (take 1000-2000)

These changes prevent the Convex backend from loading entire tables
into memory, which was causing OOM kills at 16GB and WebSocket
disconnections (code 1006).

Expected RAM reduction: 60-80% at peak usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 19:23:10 -03:00
esdrasrenan
d01c37522f feat: SSE para chat desktop, rate limiting, retry, testes e atualizacao de stack
- Implementa Server-Sent Events (SSE) para chat no desktop com fallback HTTP
- Adiciona rate limiting nas APIs de chat (poll, messages, sessions)
- Adiciona retry com backoff exponencial para mutations
- Cria testes para modulo liveChat (20 testes)
- Corrige testes de SMTP (unit tests para extractEnvelopeAddress)
- Adiciona indice by_status_lastActivity para cron de sessoes inativas
- Atualiza stack: Bun 1.3.4, React 19, recharts 3, noble/hashes 2, etc

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 16:29:18 -03:00
Esdras Renan
c5ddd54a3e chore: prep platform improvements 2025-11-09 21:09:38 -03:00
Esdras Renan
6ab8a6ce89 feat: agenda polish, SLA sync, filters 2025-11-08 02:34:43 -03:00
Esdras Renan
216feca971 feat(tickets): preserve requester/assignee/company snapshots + timeline fallbacks; chore: add requester index\n\n- Add requesterSnapshot, assigneeSnapshot, companySnapshot to tickets\n- Use snapshots as fallback in list/get/play\n- Update snapshots on assignee changes/startWork\n- Preserve snapshots before deleting users/companies\n- Add index tickets.by_tenant_requester\n- Add migrations.backfillTicketSnapshots\n\nchore(convex): upgrade to ^1.28.0 and run codegen\nchore(next): upgrade Next.js to 15.5.6 and update React/eslint-config-next\nfix: remove any and lint warnings; tighten types across API routes and components\ndocs: add docs/ticket-snapshots.md 2025-10-20 10:13:37 -03:00
Esdras Renan
63d6a65334 chore: snapshot comment authors before user deletion 2025-10-19 14:30:59 -03:00
Esdras Renan
5de8b2bf7f fix: align company data with machines 2025-10-18 21:57:13 -03:00
Esdras Renan
68ace0a858 refactor: quality workflow, docs, tests 2025-10-16 19:14:46 -03:00
Esdras Renan
2cba553efa Implement company provisioning codes and session tweaks 2025-10-15 20:45:25 -03:00
Esdras Renan
b5fd920efd docs: registrar fluxo do updater e atualizar chaves 2025-10-12 04:06:29 -03:00
Esdras Renan
3bafcc5a0a feat: CSV exports, PDF improvements, play internal/external with hour split, roles cleanup, admin companies with 'Cliente avulso', ticket list spacing/alignment fixes, status translations and mappings 2025-10-07 13:42:45 -03:00
Esdras Renan
1cccb852a5 chore: reorganize project structure and ensure default queues 2025-10-06 22:59:35 -03:00
Renamed from web/convex/migrations.ts (Browse further)