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

whowas swallows older replies #371

Closed
brunnre8 opened this issue Dec 27, 2023 · 3 comments · Fixed by #372
Closed

whowas swallows older replies #371

brunnre8 opened this issue Dec 27, 2023 · 3 comments · Fixed by #372

Comments

@brunnre8
Copy link
Contributor

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.

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

brunnre8 commented Dec 27, 2023

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

@ItsOnlyBinary
Copy link
Contributor

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

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

brunnre8 added a commit to brunnre8/irc-framework that referenced this issue Dec 28, 2023
Whowas results are a list of all known RPL_WHOWASUSER replies.
Return the most recent event as the top level and add the
rest to a `historical` field as an array.

Example:

```
:inspircd.server.example 314 val someone ident3 127.0.0.1 * :Realname
:inspircd.server.example 312 val someone My.Little.Server :Sun Mar 20 2022 10:59:26
:inspircd.server.example 314 val someone ident2 127.0.0.1 * :Realname
:inspircd.server.example 312 val someone My.Little.Server :Sun Mar 20 2022 10:59:16
:inspircd.server.example 314 val someone ident1 127.0.0.1 * :Realname
:inspircd.server.example 312 val someone My.Little.Server :Sun Mar 19 2022 9:23:06
:inspircd.server.example 369 val someone :End of WHOWAS

whowas {
  nick: 'someone',
  ident: 'ident3',
  hostname: '127.0.0.1',
  real_name: 'Realname',
  server: 'My.Little.Server',
  server_info: 'Sun Mar 20 2022 10:59:26',
  historical: [
    {
      nick: 'someone',
      ident: 'ident2',
      hostname: '127.0.0.1',
      real_name: 'Realname',
      server: 'My.Little.Server',
      server_info: 'Sun Mar 20 2022 10:59:16'
    },
    {
      nick: 'someone',
      ident: 'ident1',
      hostname: '127.0.0.1',
      real_name: 'Realname',
      server: 'My.Little.Server',
      server_info: 'Sun Mar 19 2022 9:23:06'
    }
  ]
}
```

Fixes: kiwiirc#371
This issue was closed.
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 a pull request may close this issue.

2 participants