Skip to content

[GOWS] WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT not working on 2026.3.4 #1987

@JuanchiRios

Description

@JuanchiRios

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

  1. Set env variable: WAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366
  2. Restart container
  3. Drop the session's GOWS database entirely (fresh start, not reusing existing data)
  4. Create a new session and scan QR code
  5. Wait for history sync to complete
  6. 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_DEVICEWAHA_GOWS_DEVICE_HISTORY_SYNC_FULL_SYNC_DAYS_LIMIT=366

Related issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions