Skip to content

fix(provider-baileys): handle QR image write failures - #1277

Merged
leifermendez merged 1 commit into
codigoencasa:builderbotfrom
harsh-thakkar7:fix/1253-qr-generation-failure
Oct 26, 2026
Merged

leifermendez merged 1 commit into
codigoencasa:builderbotfrom
harsh-thakkar7:fix/1253-qr-generation-failure

Conversation

@harsh-thakkar7

Copy link
Copy Markdown
Contributor

Que tipo de Pull Request es?

  • Mejoras
  • Bug
  • Docs / tests

Descripci贸n

Fixes #1253.

When baileyGenerateImage rejects, such as when the QR image cannot be written, the async connection.update listener also rejects. This leaves an unhandled rejection instead of a controlled provider error. Existing missing-image HTTP behavior is unchanged and continues to return 404.

Changes

  • Catch QR image-generation failures at the connection-event boundary.
  • Log a contextual error and emit a provider notice containing the failure reason.
  • Preserve the existing require_action event and raw QR payload so other QR consumers keep working.
  • Add a regression that invokes the real connection handler with a rejected image write.

Verification

  • The regression rejected before the fix; it now resolves and emits the expected notice.
  • Lifecycle tests: 19/19 passed.
  • Baileys provider suite: 255/255 passed.
  • pnpm test: all 29 monorepo test projects passed.
  • pnpm --filter @builderbot/provider-baileys build: passed.
  • pnpm run generate:check, ESLint, and Prettier checks: passed.

@leifermendez leifermendez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aprobado para el alcance acotado de capturar el rechazo de baileyGenerateImage y emitir un diagn贸stico controlado. Verificaci贸n del commit revisado: regresi贸n nueva fallando en la producci贸n base, lifecycle 19/19 y provider 255/255 en 8 suites aprobados en el head. Se preserva el require_action con el QR crudo y el comportamiento HTTP existente. Esto no garantiza una imagen v谩lida ni resuelve todas las variantes de imagen ausente de #1253.

@leifermendez
leifermendez merged commit b4da928 into codigoencasa:builderbot Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QR code generation validation in controller

2 participants