Skip to content

fix(whatsapp): messages stuck at Sending - add ACK timeout and retry #1344

Open

Description

@khaira777

Parent: #830 (chat leftovers). Verified against main @ 8e39053.

Bug

WhatsApp messages can stay at "Sending" forever (user report, 14 Sep).

Root cause (verified in code)

Fix (decided)

Acceptance criteria

  • A message without an ACK becomes failed (ack_timeout) after the timeout.
  • A late ACK still upgrades it to sent/delivered.
  • Rows stuck from before a restart are swept on startup.
  • Retry sends once (no duplicates) and is blocked in Offline mode.

Verification

  • Extend tests/whatsapp-service.test.ts with fake timers covering the timeout, a late ACK, the startup sweep and retry idempotency.
  • npm run lint && npm test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendBackend (Express/SQLite)area:frontendFrontend (React/Next.js)state:readyScoped and ready for implementationtype:bugA confirmed defect in existing behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions