~emersion/soju#149: 
Unable to attach ##linux after joining ##Linux by mistake

case-mapping

Status
REPORTED
Submitter
~sircmpwn
Assigned to
No-one
Submitted
11 months ago
Updated
8 months ago
Labels
bug downstream

~taiite 11 months ago

Is this on libera? they redirect ##Linux to #linux, but not ##linux.. I get kicked out of ##linux as soon as i join.

Since they advertise CASEMAPPING=ascii, both channels should be the same[0][1] but, whatever......

This is what must have happened when you asked soju to join ##Linux:

  • soju stored ##Linux in the db, but
  • libera replied with a :sircmpwn JOIN #linux,
  • soju forwarded this message to your client but did not alter the db: the db can only be edited by downstreams,
  • your client got the message and added #linux to its buffer list.

when you type /part:

  • soju forwards it to libera but does not alter the db, because #linux != ##Linux (even with case-mapping),
  • libera replies with :sircmpwn PART #linux,
  • soju forwards the message and your client closes the buffer.

when you type /part ##Linux:

  • soju removes ##Linux from the db and forwards the message to libera,
  • libera replies with ERR_NOTONCHANNEL, since you're on #linux,
  • soju forwards the message and your client shouldn't do anything except print the error.

when you type /part ##linux:

  • soju removes ##Linux from the db the db, because ##linux == ##Linux, because libera advertises CASEMAPPING=ascii,
  • soju forwards the message,
  • libera replies with ERR_NOTONCHANNEL, since you're on #linux,
  • soju forwards the message and your client shouldn't do anything except print the error.

tl;dr: /part #linux to part on libera and /part ##linux to delete the channel in soju's db

[0] https://datatracker.ietf.org/doc/html/rfc2812#section-1.3 [1] https://modern.ircdocs.horse/#casemapping-parameter

~emersion 11 months ago*

This is about ##linux vs. ##Linux, I don't think ~sircmpwn has ever tried #linux.

I think we're doing a case-mapping unaware string comparison somewhere in the detach/attach code.

~xse 9 months ago

Hey, i might be experiencing some kind of related issue. Using gamja+soju, i joined #nodejs and got redirected to #node.js which i then left. But soju was unable to delete #node.js even tho the channel window in gamja closed. When soju now starts/restart, it still tries to join #nodejs, gets redirected, and the cycle begins anew. Here are the relevant soju logs:

Dec 05 03:07:51 buttplug soju[4546]: 2021/12/05 03:07:51 user "xse": upstream "libera": unhandled message: @time=2021-12-05T02:07:51.651Z :strontium.libera.chat 470 xse #nodejs #node.js :Forwarding to another channel
Dec 05 03:07:51 buttplug soju[4546]: 2021/12/05 03:07:51 user "xse": upstream "libera": joined channel "#node.js"
Dec 05 03:07:59 buttplug soju[4546]: 2021/12/05 03:07:59 downstream "192.168.1.10": failed to delete channel "#node.js": unknown channel "#node.js"

Not sure if there's a /part solution to this since gamja don't take the /part #channel argument, i might have to peak in postgresql and remove an entry in there. Have a good day :3

~taiite referenced this from #170 9 months ago

0x5c 8 months ago · edit

Libera does not announce casemap ascii, but CASEMAPPING=rfc1459. Downstreams receive CASEMAPPING=ascii (even in single-upstream mode) because it is hardcoded in downstream.go:1357.

~emersion 8 months ago

Yes, but this is unrelated. CASEMAPPING=ascii should still make it as #Linux and #Linux are equivalent. See the motivation for the CASEMAPPING in https://git.sr.ht/~emersion/soju/commit/bdd0c7bc06ece87b796c5ad0d5b248d4c14fd4ef.

classabbyamp referenced this from #202 a month ago

Register here or Log in to comment, or comment via email.