ircv3 / ircv3-specifications

IRCv3 specifications | Roadmap: https://git.io/IRCv3-Roadmap | Code of conduct: http://ircv3.net/conduct.html
http://ircv3.net
785 stars 79 forks source link

CHATHISTORY: Clarify a limit of 0 in messages #515

Open Herringway opened 1 year ago

Herringway commented 1 year ago

It is unclear what a server is expected to do when receiving a limit of 0 in a CHATHISTORY message. Does it mean no messages? Or does it mean no limit, like in the ISUPPORT token? The latter option seems much more useful and consistent, IMO.

nektro commented 1 year ago

Given,

Request up to limit number of messages [...]

and

While an ISUPPORT token value of 0 may be used to indicate no message limit exists, servers SHOULD set and enforce a reasonable maximum and properly throttle CHATHISTORY commands to prevent abuse.

I read this as a <limit> of 0 would return no messages.

Herringway commented 1 year ago

I cannot see how "no message limit" could be interpreted as "a limit of zero messages".

slingamn commented 1 year ago

The semantics of the 005 token and the limit argument of the CHATHISTORY command are separate. The specification, as written, entails that a CHATHISTORY command with a limit argument of 0 receives an empty batch.

mokou commented 7 months ago

A <limit> of 0 to indicate "no message limit" or "some default limit" would IMO be more useful than making a request for "0 messages". I don't see why anyone would ever desire the latter.

If a <limit> of 0 isn't desired as "no message limit" for whatever reason, allowing for the use of * to indicate "some default limit" would be nice.

I would hope this gets addressed before #437 is completed.

nektro commented 7 months ago

I cannot see how "no message limit" could be interpreted as "a limit of zero messages".

because I interpreted this parameter as a direct argument to something like https://www.sqlite.org/lang_select.html#the_limit_clause

slingamn commented 7 months ago

If a of 0 isn't desired as "no message limit" for whatever reason, allowing for the use of * to indicate "some default limit" would be nice.

Could you clarify the use case here? The CHATHISTORY command is not intended for use by end users directly, it's intended for programmatic use by client software. Is there a reason client software would not be able to choose its own limit?

mokou commented 7 months ago

If a of 0 isn't desired as "no message limit" for whatever reason, allowing for the use of * to indicate "some default limit" would be nice.

Could you clarify the use case here? The CHATHISTORY command is not intended for use by end users directly, it's intended for programmatic use by client software. Is there a reason client software would not be able to choose its own limit?

Ah, I somehow missed the part where it says a CHATHISTORY ISUPPORT token MUST be sent with the server's limit. With that in mind I can't imagine a <limit> of * being all that useful.