Describe the bug
WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366 has no effect on history sync depth. Messages are still synced all the way back to 2017, well beyond the 366-day limit.
This is a follow-up to #1963 — we reported the same issue on 2026.3.3 (which also had a version string bug reporting 2026.3.1). We upgraded to 2026.3.4 which fixes the version string, but the history sync limit is still not applied.
Version
{"version":"2026.3.4","engine":"GOWS","tier":"PLUS","browser":null,"platform":"linux/x64","worker":{"id":"worker-1"}}
Steps to reproduce
- Set env variable:
WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366
- Restart container
- Drop the session's GOWS database entirely (fresh start, not reusing existing data)
- Create a new session and scan QR code
- Wait for history sync to complete
- Query
gows_messages: SELECT min(timestamp), max(timestamp), count(*) FROM gows_messages;
Expected behavior
Oldest message should be no older than ~366 days (around March 2025).
Actual behavior
oldest | newest | total
---------------------+---------------------+-------
2017-03-29 17:36:44 | 2026-03-28 14:50:35 | 25679
Messages synced back to 2017 (~9 years), completely ignoring the 366-day limit.
Additional testing
We also tried wiping (TRUNCATE gows_messages) and letting it re-sync — same result, messages go back to 2017 again.
Distribution by year:
| Year |
Messages |
| 2017 |
6 |
| 2018 |
5 |
| 2019 |
20 |
| 2020 |
12 |
| 2021 |
4 |
| 2022 |
2 |
| 2023 |
2 |
| 2024 |
26 |
| 2025 |
1,526 |
| 2026 |
24,076 |
The old messages (pre-2025) are mostly from group chats (@g.us) with from_me=true, possibly group metadata/system messages leaking through.
Environment
- Image:
devlikeapro/waha-plus:gows-2026.3.4
- Platform: linux/x64 (GCE VM)
- PostgreSQL storage
- Env var confirmed present in container:
docker exec waha env | grep GOWS_DEVICE → WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366
Related issues
Describe the bug
WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366has no effect on history sync depth. Messages are still synced all the way back to 2017, well beyond the 366-day limit.This is a follow-up to #1963 — we reported the same issue on
2026.3.3(which also had a version string bug reporting2026.3.1). We upgraded to2026.3.4which fixes the version string, but the history sync limit is still not applied.Version
{"version":"2026.3.4","engine":"GOWS","tier":"PLUS","browser":null,"platform":"linux/x64","worker":{"id":"worker-1"}}Steps to reproduce
WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366gows_messages:SELECT min(timestamp), max(timestamp), count(*) FROM gows_messages;Expected behavior
Oldest message should be no older than ~366 days (around March 2025).
Actual behavior
Messages synced back to 2017 (~9 years), completely ignoring the 366-day limit.
Additional testing
We also tried wiping (
TRUNCATE gows_messages) and letting it re-sync — same result, messages go back to 2017 again.Distribution by year:
The old messages (pre-2025) are mostly from group chats (
@g.us) withfrom_me=true, possibly group metadata/system messages leaking through.Environment
devlikeapro/waha-plus:gows-2026.3.4docker exec waha env | grep GOWS_DEVICE→WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366Related issues