Skip to content

[Bug]: GET /channels/{channelId}/messages returns empty array [] (200 OK) for channels #625

Description

@Header9968

Pre-flight

  • I searched existing issues and this isn't a duplicate
  • I'm on the latest released version (or noted my version below)

OpenWA version

OpenWA v0.8.7

Deployment

Docker Compose

Database

SQLite (default)

WhatsApp engine

whatsapp-web.js

What happened?

Description

The endpoint GET /api/sessions/{sessionId}/channels/{channelId}/messages
returns an empty array [] with HTTP 200, even though the target channel
(newsletter) contains many messages. No error is thrown — the response is
simply empty.

Version

OpenWA v0.8.7

Steps to Reproduce

  1. Have a session subscribed to a WhatsApp channel (newsletter).
  2. Confirm the channel appears in GET /channels (it does, with correct name/id).
  3. Confirm the channel has messages (visible in the WhatsApp app).
  4. Call GET /api/sessions/{sessionId}/channels/{channelId}/messages
    with a valid X-API-Key.

Expected Behavior

The endpoint should return the list of channel messages
(as documented: "List of channel messages").

Actual Behavior

  • Status: 200 OK
  • Response body: []
  • Response header: content-length: 2

The array is always empty regardless of limit value or channel.

Additional Context

  • GET /channels works correctly and lists all subscribed channels.
  • The same channel messages ARE retrievable through a different WhatsApp
    API gateway (Evolution API) using the same session/account, which
    suggests the messages exist and are accessible — the issue appears
    specific to this endpoint's implementation.
  • Engine: whatsapp-web.js (default ENGINE_TYPE).

Environment

  • OpenWA version: 0.8.7
  • Engine: whatsapp-web.js
  • Deployment: self-hosted (Docker / [укажите ваше])

Steps to reproduce

Description

The endpoint GET /api/sessions/{sessionId}/channels/{channelId}/messages
returns an empty array [] with HTTP 200, even though the target channel
(newsletter) contains many messages. No error is thrown — the response is
simply empty.

Version

OpenWA v0.8.7

Steps to Reproduce

  1. Have a session subscribed to a WhatsApp channel (newsletter).
  2. Confirm the channel appears in GET /channels (it does, with correct name/id).
  3. Confirm the channel has messages (visible in the WhatsApp app).
  4. Call GET /api/sessions/{sessionId}/channels/{channelId}/messages
    with a valid X-API-Key.

Expected Behavior

The endpoint should return the list of channel messages
(as documented: "List of channel messages").

Actual Behavior

  • Status: 200 OK
  • Response body: []
  • Response header: content-length: 2

The array is always empty regardless of limit value or channel.

Additional Context

  • GET /channels works correctly and lists all subscribed channels.
  • The same channel messages ARE retrievable through a different WhatsApp
    API gateway (Evolution API) using the same session/account, which
    suggests the messages exist and are accessible — the issue appears
    specific to this endpoint's implementation.
  • Engine: whatsapp-web.js (default ENGINE_TYPE).

Environment

  • OpenWA version: 0.8.7
  • Engine: whatsapp-web.js
  • Deployment: self-hosted (Docker / [укажите ваше])

Expected behavior

No response

Relevant logs

Environment / additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions