Fix: shouldSyncHistoryMessage debe retornar true cuando no hay timestamp
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m9s

El check inicial de Baileys pasa un objeto sin messageTimestamp.
Cuando era undefined, la comparación retornaba false y Baileys
deshabilitaba la sincronización de historial completamente.
This commit is contained in:
2025-12-04 12:38:09 -06:00
parent 32f66c8fe0
commit af5ed0f0c5

View File

@@ -159,9 +159,11 @@ class BaileysManager extends EventEmitter {
syncFullHistory: true,
markOnlineOnConnect: false,
// Sync history messages from the last 30 days
// IMPORTANTE: Si no hay messageTimestamp, retornar true para permitir el check inicial de Baileys
shouldSyncHistoryMessage: (msg) => {
if (!msg.messageTimestamp) return true
const thirtyDaysAgo = Date.now() / 1000 - (30 * 24 * 60 * 60)
return msg.messageTimestamp! >= thirtyDaysAgo
return msg.messageTimestamp >= thirtyDaysAgo
},
// getMessage for resending/decrypting messages
getMessage: async (key) => {