waha icon indicating copy to clipboard operation
waha copied to clipboard

[WEBJS] - Incorret group participants data

Open alvaromoura-nibo opened this issue 6 months ago • 1 comments

Describe the bug

The POST /api/{session}/groups/refresh endpoint does not seem to refresh chats/groups metadata properly.

A WAHA session was already in WORKING state.

Scenario:

  • a participant joins the group
  • the REST endpoints correctly return the participant
  • shortly after, the participant leaves the group
  • the REST endpoints continue returning stale participant data

The following endpoints did not reflect the real group state:

  • GET /groups/{groupId}
  • GET /groups/{groupId}/participants/v2

even after calling:

POST /api/{session}/groups/refresh

multiple times.

This makes it impossible to reliably use WAHA REST endpoints as the source of truth for group participants/admins.


Version

{
    "version": "2026.4.3",
    "engine": "WEBJS",
    "tier": "PLUS",
    "browser": "/usr/bin/google-chrome",
    "platform": "linux/x64",
    "worker": {
        "id": null
    }
}

Steps

To Reproduce

  1. Create or use an existing WhatsApp group

  2. Start a WAHA session using WEBJS

  3. Ensure the session state is WORKING

  4. Add a participant to the group

  5. Confirm the participant appears correctly in:

    • GET /groups/{groupId}
    • GET /groups/{groupId}/participants/v2
  6. Remove or make the participant leave the group

  7. Call:

POST /api/{session}/groups/refresh
  1. Then call:
GET /api/{session}/groups/{groupId}

and/or

GET /api/{session}/groups/{groupId}/participants/v2
  1. Observe that the removed participant still appears in the response

Expected behavior

After a participant leaves the group and after calling the refresh endpoint, group metadata and participants endpoints should reflect the current WhatsApp group state.

The removed participant should no longer appear in:

GET /groups/{groupId}

and

GET /groups/{groupId}/participants/v2

Requests - Responses

Refresh request

POST /api/default/groups/refresh

Response:

{
  "success": true
}

Participants request

GET /api/default/groups/[email protected]/participants/v2

Response:

[
  {
    "id": "[email protected]",
    "role": "participant"
  },
  {
    "id": "[email protected]",
    "role": "participant"
  }
]

Expected:

[
  {
    "id": "[email protected]",
    "role": "participant"
  }
]

Docker Logs

No relevant errors appear in docker logs.


Screenshots

N/A


Additional context

This issue seems related to stale synchronization/cache inside the WEBJS engine.

The issue specifically happens after a participant leaves the group.

The problem persists even after:

  • calling refresh multiple times
  • waiting several seconds/minutes
  • reconnecting the session

Also reproduced with:

  • GET /groups/{groupId}
  • GET /groups/{groupId}/participants/v2

The returned data does not match the actual WhatsApp group state.

patron:PRO

alvaromoura-nibo avatar May 08 '26 20:05 alvaromoura-nibo

+1

patron:PRO

leonardolimafarias avatar May 08 '26 20:05 leonardolimafarias