fix: cron enabled=1 + plan-b reenvio automático de imagens ausentes
continuous-integration/webhook Deploy concluído (VPS4)

Bug fix:
- server.js e routes/images.js: 'enabled = true' → 'enabled = 1'
  (PostgreSQL rejeita smallint = boolean — causava 'operator does not exist')

Plan B — imagens ausentes no Wasabi:
- server.js: pendingReupload (Map clientName → Set<original_filename>)
  quando getImageBufferWithFallback retorna null no endpoint /thumbnail,
  scheduleReupload() registra o original_filename e emite 'reupload-files'
  imediatamente se o cliente estiver online, ou na próxima conexão.
- server.js: client-identify agora drena a fila pendente do cliente ao
  reconectar, antes de emitir clients-list-updated.
- original_filename adicionado ao SELECT do endpoint /thumbnail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
VPS 4 Deploy Agent
2026-05-31 06:52:39 +02:00
parent 75ce7c1f36
commit e716e0e131
2 changed files with 45 additions and 6 deletions
+1 -1
View File
@@ -571,7 +571,7 @@ router.post('/backfill-thumbs', async (req, res) => {
const rows = await db.all(
`SELECT id, filename, clinic_name, client_name, patient_name
FROM images
WHERE thumb_filename IS NULL AND enabled = true
WHERE thumb_filename IS NULL AND enabled = 1
ORDER BY created_at DESC`
);
res.json({ queued: rows.length, message: 'Backfill iniciado em background' });