Skip to content

CHATHISTORY errors when chathistory-maxmessages is not set #2303

@branchgrove

Description

@branchgrove

With the following config:

history:
  enabled: true
  persistent:
    enabled: true
    unregistered-channels: true
    registered-channels: "mandatory"
    direct-messages: "mandatory"

You get this:

<- CHATHISTORY TARGETS timestamp=1969-12-31T23:59:55.000Z timestamp=2025-12-12T22:50:03.338Z 500
-> FAIL CHATHISTORY INVALID_TARGET TARGETS * :Messages could not be retrieved
<- CHATHISTORY LATEST #channel timestamp=2025-12-12T22:49:50.760Z 500
-> FAIL CHATHISTORY INVALID_TARGET LATEST * :Messages could not be retrieved

My assumption based on the default.yaml in the repository is that chathistory-maxmessages and znc-maxmessages are set by default. Updating the config to:

history:
  enabled: true
  chathistory-maxmessages: 2048
  znc-maxmessages: 2048
  persistent:
    enabled: true
    unregistered-channels: true
    registered-channels: "mandatory"
    direct-messages: "mandatory"

resolves the chathistory failures.

My assumption then became that these values are initialized to 0 as is the golang default but after seeing this:

ergo/irc/config.go

Lines 1794 to 1798 in aef5d77

if config.History.Enabled && config.History.ChathistoryMax > 0 {
isupport.Add("CHATHISTORY", strconv.Itoa(config.History.ChathistoryMax))
// Kiwi expects this legacy token name:
isupport.Add("draft/CHATHISTORY", strconv.Itoa(config.History.ChathistoryMax))
}
i'm quite confused as i still see the draft/chathistory capability when connecting with the invalid config.

I had errors with both halloy and goguma.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions