Fix: fetchMessageHistory con evento SSE y logs de debug
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m9s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m9s
- Agregar logs detallados en /api/debug/history/fetch para diagnosticar - Emitir evento SSE 'history.synced' cuando llegan mensajes del historial - Frontend ahora escucha el evento SSE en vez de timeout fijo de 3 segundos - Agregar script y documentación para referencia de Baileys message history
This commit is contained in:
@@ -473,6 +473,15 @@ class BaileysManager extends EventEmitter {
|
||||
}
|
||||
|
||||
console.log(`[BaileysManager] History sync processed`)
|
||||
|
||||
// Emitir evento SSE al frontend para notificar que llegó el historial
|
||||
this.emit('history.synced', {
|
||||
instanceId,
|
||||
chatsCount: chats?.length || 0,
|
||||
contactsCount: contacts?.length || 0,
|
||||
messagesCount: messages?.length || 0,
|
||||
syncType
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user