kiwiirc / irc-framework

🛠️ A better IRC framework for node.js. For bots and full clients.
MIT License
180 stars 62 forks source link

whowas swallows older replies #371

Open brunnre8 opened 6 months ago

brunnre8 commented 6 months ago

Whowas is a list: https://modern.ircdocs.horse/#whowas-message

Unless the command is executed as WHOWAS 1, the returned data is a list of all known RPL_WHOWASUSER replies.

e0460361370f01d6c9608349bfa71c9ee51c0c3a changed the semantics from sending all replies observed to just the last. The way the protocol works is that the first entry is the most recent, so effectively this means that on a multi reply the framework only emits the oldest, which is the least useful for most users (citation needed).

This doesn't seem intentional, there's a couple of ways of addressing this:

  1. Ignore subsequent RPL_WHOWASUSER replies, return the first
  2. Introduce an event that emits all of it as a list (whowaslist ?) If this is preferred, how do you wanna treat whowas ? Keep sending the oldest? Start sending the newest?
  3. Emit all events separately, same as pre e0460361370f01d6c9608349bfa71c9ee51c0c3a
  4. Change to a list and emit all of it at the same time --> breaking change (probably not, due to the breaking nature)

Now, what's your preferred option there?

brunnre8 commented 6 months ago

Just in case it isn't obvious, I'd be happy to write the patch after you tell me which option you prefer.

ItsOnlyBinary commented 6 months ago

I think at a minimum whowas should give the most recent, but instead of another event for it what about adding an array of previous entries to the same event? That way it will still be backwards compatible but contain the extra info for anyone wanting to use it.

brunnre8 commented 6 months ago

it's certainly an option but slightly akward as any client that just wants to show all of them needs to process the main event first, then loop over the "older" (however that's then named) array and do the same rendering logic there. It's slightly nicer to just have a single loop with no special handling