8000 updates to metadata spec by slingamn · Pull Request #566 · ircv3/ircv3-specifications · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

updates to metadata spec #566

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

slingamn
Copy link
Contributor
@slingamn slingamn 8000 commented Jun 20, 2025

These came out of my review of the initial metadata implementation in Ergo, contributed by @thatcher-gaming. They're more starting points for discussion than polished amendments. A brief summary:

  • before-connect allows clients to modify both their metadata and their subscriptions during connection registration. For conventional IRC stacks without persistent clients, this makes perfect sense. For bouncers and implementations like Ergo with persistent clients, it makes sense to be able to modify subscriptions, but clients probably shouldn't be unilaterally pushing metadata updates on every reconnection, since they may overwrite more up-to-date metadata that was set from another client. This adds a new cap value key, sub-before-connect, that indicates that subscriptions are accepted during connection registration, but SET etc. are not.
  • Adds a batch parameter: the name of the primary target of the metadata request. Without this, the empty batch is uninterpretable (at least without labeled-response).
  • Removes the edge-triggered requirement to send the client's own metadata when the cap is requested
  • As a replacement for this, specifies that the server sends metadata-negotiating clients a batch of their own metadata during the reg burst

Something not addressed here is that 772 RPL_METADATASUBS is effectively unusable without labeled-response, since there is no indication of where it ends. An initial proposal: a 772 line with no parameters after the client's nick could be taken as the end of the subscriptions? We could also add a new RPL_ENDOFMETADATASUBS.

@jwheare
Copy link
Member
jwheare commented Jun 20, 2025

Re: sub-before-connect can't this just be a client setting?

Removes the edge-triggered requirement to send the client's own metadata when the cap is requested

I don't understand what this means and how it relates to the change. Can you provide more detail?

@slingamn
Copy link
Contributor Author
slingamn commented Jun 20, 2025

Re: sub-before-connect can't this just be a client setting?

If I understand the question correctly: the point of having a separate server cap value here is to inform clients that the server may be storing persistent metadata that they shouldn't preemptively overwrite. Making this a client setting would probably require the end user to be aware of this, which seems undesirable. (I'm also open to making this a value of before-connect, e.g. draft/metadata=before-connect=subs,max-subs=50, where no value or * is the original behavior.)

re. the CAP REQ behavior, the original language is:

Upon requesting the metadata capability, clients receive their non-transient metadata (for example, metadata stored by the server or by services) in a metadata batch with their own nick as target. If none exists, the server MUST send an empty batch instead.

As per discussion on #543 I prefer that requesting a CAP should not have side effects. This is amended to:

If the metadata capability was negotiated during connection registration, clients receive their current metadata (any metadata stored by the server or by services, plus any metadata set by the client during connection registration via before-connect) in a metadata batch with their own nick as target as part of the registration burst, i.e. before RPL_ENDOFMOTD or ERR_NOMOTD. If none exists, the server MUST send an empty batch instead.

The concrete changes in behavior being:

  • There is no direct side effect of requesting the CAP
  • Better integration with persistent clients and bouncers; by the time connection registration is complete, the server should know what persistent metadata is set. (In contrast, if the CAP is requested during connection registration but before SASL, the server will be unaware of the state of persistent metadata. Even after SASL, this will probably be implementation-dependent in some cases, e.g. if the same account can be associated with multiple nicknames / presences.)
  • The batch is sent during the registration burst
  • (edit:) Clients requesting the CAP post-registration do not receive anything (but they can do METADATA LIST on themselves)

@jwheare
Copy link
Member
jwheare commented Jun 20, 2025

What would happen if a client did try to overwrite the metadata? They may want to e.g. set a key that indicates where they're logging in from.

I don't follow how the CAP REQ change prevents side effects, it still says "clients receive their current metadata"

@slingamn
Copy link
Contributor Author

I don't follow how the CAP REQ change prevents side effects, it still says "clients receive their current metadata"

They don't receive it in response to the CAP REQ command itself, they receive it in the registration burst. The philosophy here is (among other considerations) to avoid ordering dependencies (like the one with SASL mentioned above) during registration --- in contrast, the decision to complete registration (typically by sending CAP END) is deliberate, explicit, and occurs after the client has finished sending all relevant data.

What would happen if a client did try to overwrite the metadata? They may want to e.g. set a key that indicates where they're logging in from.

I think for implementations with persistent presence and metadata support, and which are designed to accept short-lived connections, rejecting pre-connect updates is probably a good tradeoff since they are likely to be spammy as well as out-of-date. But the tradeoff is real, and not just for keys like the one you're describing, because non-persistent clients will have to connect without being able to pre-set any metadata.

@jwheare
Copy link
Member
jwheare commented Jun 20, 2025

Ah, in response to CAP END vs CAP REQ makes sense, that wasn't really clear from the wording.

I think for implementations with persistent presence and metadata support, and which are designed to accept short-lived connections, rejecting pre-connect updates is probably a good tradeoff since they are likely to be spammy as well as out-of-date. But the tradeoff is real, and not just for keys like the one you're describing, because non-persistent clients will have to connect without being able to pre-set any metadata.

I feel like that tradeoff is exactly why it should be a client setting, should be in the user's control.

@slingamn
Copy link
Contributor Author

Ah, in response to CAP END vs CAP REQ makes sense, that wasn't really clear from the wording.

Open to changing the wording! I feel like the actual spec amendment is fairly clear though, and the problem is more that my PR description and comments about it were confusing :-)

I feel like that tradeoff is exactly why it should be a client setting, should be in the user's control.

This is a more expansive conversation but I think historically IRC has erred in making client configuration too burdensome. The most successful IRC clients now are extremely low-configuration (think Kiwi, Gamja, and Goguma). Having the user figure out the state of server-side persistence and check or uncheck a box in response seems like a pretty bad outcome (although in terms of making this automatically discoverable, #503 is relevant).

A rough implementation compromise that occurs to me:

  • An implementation with persistent clients can advertise before-connect in its currently specified state
  • Once connection registration is complete, accept any set keys that don't overwrite existing keys, ignore others, and send the resulting metadata state as a batch in the registration burst. (For non-persistent clients, this is the standard before-connect behavior.)

This reverts commit e5dbbd1.
@slingamn
Copy link
Contributor Author

Withdrawing the proposal of sub-before-connect for now; interested in discussion on the other points (including adding an indication of termination for 772 RPL_METADATASUBS --- another possibility I didn't bring up is to always batch it, similar to 761 RPL_KEYVALUE).

@slingamn
Copy link
Contributor Author

Currently, key names are "restricted to the ranges A-Z, a-z, 0-9, and _./- and are case-insensitive." Case-insensitivity creates a number of potential correctness issues (for both clients and servers), seemingly to no real benefit. Could we just require that key names are lowercase instead, i.e. remove A-Z from the allowed characters?

This includes the proposed change of behavior where the existing metadata
is sent as part of the reg burst, instead of in response to CAP REQ.
* Disallow colon entirely as in ircv3#567
* Disallow A-Z
* Remove requirement of case-insensitive handling
slingamn and others added 4 commits June 22, 2025 15:38
Co-authored-by: Val Lorentz <progval+github@progval.net>
Co-authored-by: Val Lorentz <progval+github@progval.net>
* RPL_METADATASUBS is batched with the metadata-subs batch type
* Clarify when the metadata batch type is used
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

Successfully merging this pull request may close these issues.

3 participants
0