Describe the bug
When listing messages from a chat using the GET /api/messages endpoint on the NOWEB engine, combining both filter.timestamp.gte and filter.timestamp.lte filters does not correctly restrict the results to the specified time range.
Messages sent before the gte value and after the lte value are still returned in the response, as if the range boundaries are being ignored when both filters are used simultaneously.
When either filter is used in isolation, the behavior is correct:
filter.timestamp.gte alone correctly excludes messages before the given timestamp.
filter.timestamp.lte alone correctly excludes messages after the given timestamp.
To Reproduce
- Have a chat with messages spread across different timestamps (e.g., messages from yesterday, today morning, and today afternoon).
- Call
GET /api/messages with both filters set to a narrow window:
GET /api/{session}/chats/{chatId}/messages?filter.timestamp.gte=1712000000&filter.timestamp.lte=1712003600
-
Observe that the response includes messages outside the [gte, lte] range — both older and newer than the specified interval.
-
Repeat with only one filter at a time:
GET /api/{session}/chats/{chatId}/messages?filter.timestamp.gte=1712000000
GET /api/{session}/chats/{chatId}/messages?filter.timestamp.lte=1712003600
- Observe that each individual filter works correctly.
Expected behavior
When both filter.timestamp.gte and filter.timestamp.lte are provided together, the API should return only messages whose timestamp satisfies the condition:
gte <= message.timestamp <= lte
No messages outside this range should be included in the response.
Actual behavior
Messages outside the specified [gte, lte] window are returned. The combined filter appears to be applied incorrectly — possibly only one of the two conditions is being enforced, or the logical operator between them is OR instead of AND.
Engine
Environment
- WAHA version: 2026.3.4
- Deployment: Docker
Describe the bug
When listing messages from a chat using the
GET /api/messagesendpoint on the NOWEB engine, combining bothfilter.timestamp.gteandfilter.timestamp.ltefilters does not correctly restrict the results to the specified time range.Messages sent before the
gtevalue and after theltevalue are still returned in the response, as if the range boundaries are being ignored when both filters are used simultaneously.When either filter is used in isolation, the behavior is correct:
filter.timestamp.gtealone correctly excludes messages before the given timestamp.filter.timestamp.ltealone correctly excludes messages after the given timestamp.To Reproduce
GET /api/messageswith both filters set to a narrow window:Observe that the response includes messages outside the
[gte, lte]range — both older and newer than the specified interval.Repeat with only one filter at a time:
Expected behavior
When both
filter.timestamp.gteandfilter.timestamp.lteare provided together, the API should return only messages whose timestamp satisfies the condition:No messages outside this range should be included in the response.
Actual behavior
Messages outside the specified
[gte, lte]window are returned. The combined filter appears to be applied incorrectly — possibly only one of the two conditions is being enforced, or the logical operator between them isORinstead ofAND.Engine
Environment