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

Ambiguity surrounding trailing lists #205

Open
ejmount opened this issue Mar 22, 2023 · 3 comments
Open

Ambiguity surrounding trailing lists #205

ejmount opened this issue Mar 22, 2023 · 3 comments

Comments

@ejmount
Copy link

ejmount commented Mar 22, 2023

The current grammar for the parameters in a message coming from the client says that everything following a colon is treated as a single parameter, since trailing has no further structure beyond the individual characters making it up.

However, the section describing parameter lists could be to read to suggest that in something like JOIN <channel>{,<channel>}, the channel parameter should be read as appearing multiple times. The language about the Join message itself explicitly refers to the Nth <channel>, suggesting the same thing, rather than attempting to interpret the entire list as a single paramter that then gets interpreted later.

However, that implies JOIN :#a,#b will be read as attempting to join a single channel called #a,#b, which will presumably fail. I've been talking to @jesopo (@\jess on #libera) about this while developing a server, as she mentioned that inspircd changing behaviour had broken clients when it added a colon where it wasn't needed. We both agree that clients could plausibly send a message like that and expect to join two channels, but the example grammar does not appear to allow for it.

Could this be clarified?

@progval
Copy link
Member

progval commented Mar 22, 2023

These are two separate layers of the specification.

The grammar is low-level explains how to tokenize messages independently of the commands. So if you were to translate JOIN :#channel1,#channel2 to JSON, it would be: {"command": "JOIN", params: ["#channel1,#channel2"]}.
So it is, at the grammar level, a single parameter.

Now the semantics of JOIN say that this last parameter should get extra parsing when it is a JOIN command. But this doesn't contract the grammar because it is done after messages are tokenized.

as she mentioned that inspircd changing behaviour had broken clients

It mostly broke clients on MODE, because it sent: MODE +oo nick1 :nick2 while buggy clients expected MODE +oo nick1 nick2

@ejmount
Copy link
Author

ejmount commented Apr 1, 2023

Thanks for the explanation, I understand now. However, I still feel this ought to be clarified in the document itself, probably in the parameter list section. I'm happy to try making that clarification myself though, should I raise a PR?

@progval
Copy link
Member

progval commented Apr 1, 2023

I feel it's already clear enough; but go ahead and we'ill discuss it there

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

2 participants