Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHATHISTORY: Clarify a limit of 0 in messages #515

Open
Herringway opened this issue Feb 2, 2023 · 7 comments
Open

CHATHISTORY: Clarify a limit of 0 in messages #515

Herringway opened this issue Feb 2, 2023 · 7 comments

Comments

@Herringway
Copy link

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
Copy link

nektro commented Feb 3, 2023

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
Copy link
Author

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

@slingamn
Copy link
Contributor

slingamn commented Feb 3, 2023

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
Copy link

mokou commented Apr 3, 2024

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
Copy link

nektro commented Apr 3, 2024

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
Copy link
Contributor

slingamn commented Apr 4, 2024

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
Copy link

mokou commented Apr 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants