Describe the bug
GET /api/{session}/chats/{chatId}/messages returns 422 Unprocessable Entity or empty results for group chats that have recent activity. This makes catch-up after a session reconnect unreliable -- messages received while the session was down are lost.
The session status reports WORKING, webhooks for new messages work fine, but fetching recent history for the same chat fails.
Version
{
"version": "2026.3.2",
"engine": "GOWS",
"tier": "CORE"
}
Steps to reproduce
- Session is
WORKING, a group receives messages via webhook normally
- Session goes
STOPPED (or container restarts)
- Session recovers to
WORKING
- Call
GET /api/default/chats/{groupJid}/messages?limit=50
- Response:
422 Unprocessable Entity with body:
{
"error": "Session status is not as expected. Try again later or restart the session",
"session": "default",
"status": "STOPPED",
"expected": ["WORKING"]
}
- Even after session is confirmed
WORKING again, the same endpoint returns empty or 422 for several groups
Observed behavior
- Out of 18 monitored groups, 11 consistently fail with 422 on
getChatMessages after a session restart
- Retry 30 seconds later: same 422
- The groups that fail are the same every time
- Webhooks for these same groups work immediately after session recovery
- This makes post-downtime catch-up impossible for affected groups
Expected behavior
getChatMessages should return recent messages for any group the session is a member of, especially after session recovery.
Docker Logs
WARNING: failed to fetch from <groupJid>: Client error '422 Unprocessable Entity'
WARNING: Forward catch-up: failed to fetch from <groupJid>: Client error '422 Unprocessable Entity'
WARNING: Forward catch-up retry: still failing for <groupJid>
INFO: Forward catch-up: no missed messages from <groupJid>
Additional context
Describe the bug
GET /api/{session}/chats/{chatId}/messagesreturns422 Unprocessable Entityor empty results for group chats that have recent activity. This makes catch-up after a session reconnect unreliable -- messages received while the session was down are lost.The session status reports
WORKING, webhooks for new messages work fine, but fetching recent history for the same chat fails.Version
{ "version": "2026.3.2", "engine": "GOWS", "tier": "CORE" }Steps to reproduce
WORKING, a group receives messages via webhook normallySTOPPED(or container restarts)WORKINGGET /api/default/chats/{groupJid}/messages?limit=50422 Unprocessable Entitywith body:{ "error": "Session status is not as expected. Try again later or restart the session", "session": "default", "status": "STOPPED", "expected": ["WORKING"] }WORKINGagain, the same endpoint returns empty or 422 for several groupsObserved behavior
getChatMessagesafter a session restartExpected behavior
getChatMessagesshould return recent messages for any group the session is a member of, especially after session recovery.Docker Logs
Additional context
"status": "STOPPED"even when/api/sessions/defaultreturnsWORKINGWORKING