This commit improves the logging in the testProxy method of the
ProxyController class. Now, when an Axios error occurs, the specific
error message will be logged if available. For unexpected errors, the
error object is included for better insight.
For reference, see the "message" field in the Axios documentation:
[Axios Error Handling](https://axios-http.com/docs/handling_errors).
- Removed the CONFIG_SESSION_PHONE_VERSION environment variable from the configuration and Docker files.
- Updated the BaileysStartupService to directly fetch the latest WhatsApp Web version without relying on the removed environment variable.
- Adjusted the index router to reflect the changes in the WhatsApp Web version retrieval.
- Changed the `baileys` dependency source from `EvolutionAPI` to `WhiskeySockets`.
- Updated the start and development server scripts to use `tsx` instead of `tsnd`.
- Added `tsx` as a new dependency and removed `ts-node-dev`.
- Updated `music-metadata` to version 11.7.1 and adjusted its dependencies.
- Cleaned up the package-lock by removing unused modules and adding new ones like `fflate` and `uint8array-extras`.
Problema:
O método fetchChats estava aplicando a lógica de paginação duas vezes, causando resultados vazios ao usar o parâmetro skip com valores maiores que 0.
Causa Raiz:
A query SQL já aplica LIMIT e OFFSET corretamente
O código JavaScript então aplica .slice(skip, skip + take) nos resultados já paginados
Este "offset duplo" faz com que o slice tente acessar posições do array que não existem
Exemplo do bug:
Requisição: {"take": 10, "skip": 10}
SQL: LIMIT 10 OFFSET 10 → retorna chats 11-20 (10 itens)
JS: .slice(10, 20) → tenta pegar posições 10-20 de um array com apenas 10 itens
Resultado: [] (array vazio)
Solução:
Removida a lógica de paginação JavaScript redundante (linhas 796-800) já que a query SQL já manipula a paginação corretamente com LIMIT e OFFSET.
Arquivos Alterados:
src/api/services/channel.service.ts
Testes:
✅ {"take": 10, "skip": 0} - Retorna os primeiros 10 chats
✅ {"take": 10, "skip": 10} - Retorna chats 11-20 (anteriormente retornava [])
✅ {"take": 5, "skip": 15} - Retorna chats 16-20 (anteriormente retornava [])
Impacto:
Corrige a funcionalidade de paginação para todos os valores de skip > 0
Mantém compatibilidade com versões anteriores
Sem mudanças que quebrem implementações existentes