emacs-erc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59976: ERC 5.4.1: erc-networks--id gets clobbered in erc server buff


From: Mike Kazantsev
Subject: bug#59976: ERC 5.4.1: erc-networks--id gets clobbered in erc server buffer on /query name conflict
Date: Mon, 12 Dec 2022 00:00:31 +0500

Hi.

I've needed to use case-sensitive channel names (with matrix2051 ad-hoc
ircd), wanted to test updated ERC client for that, and stumbled upon
what looks like a bug there:

  When IRC server is named "slack", and then it sends you a message from
  user named "slack", ERC tries to open query-buffer "slack", ends up
  running erc--open-target("slack") which does kill-all-local-variables()
  when enabling erc-mode in the buffer.

  That removes erc-networks--id value there and from then on ERC keeps
  spamming "error in process filter" about erc-networks--id being nil.


- What I'm trying to do:

  - (erc-tls ...)  ;; cleates "slack" server buffer and some channels.
  - Open "slack" buffer
  - Send "/ping myuser" IRC-command there


- Expected result:

  Command actually results in PRIVMSG from "slack" user on this
  specific ircd, so I expect to see that open a separate query-buffer
  where that message is displayed.

  (message in question - though probably doesn't matter:
  "msg: ^APING 1670781447.080567^A could not be sent channel_not_found")


- Actual result:

  - Emacs slows down while printing following errors to MiniBuffer and 
*Messages*:

      error in process filter: or: Wrong type argument: erc-networks--id, nil
      error in process filter: Wrong type argument: erc-networks--id, nil

  - As far as I can tell that IRC connection becomes unusable, and
    errors like above get signaled from then on randomly, likely on
    some commands sent from ircd.


- Workaround: changing announced name of the server to something else
  helps - "slack" query-buffer gets created and is separate from server buffer.


Was able to understand what seem to be the issue here by enabling
logging for erc-networks--id changes to *Messages* like this:

  (defun debug-watch-log (sym newval op where)
    (message "Variable update: %s = %S -> %S [%S %S]"
      sym (symbol-value sym) newval op where)
    (backtrace))
  (add-variable-watcher 'erc-networks--id #'debug-watch-log)

(run M-x cancel-debug-on-variable-change afterwards to disable this)


I think some kind of disambiguation or conflict-detection for
query-channel names might be either missing or not working atm,
but is needed to avoid this happening unintentionally, or maybe
even on purpose (e.g. to annoy someone by cutting their IRC connection).

I'm running ERC 5.4.1 from current 0e5d059 git master on Emacs 28.2
(replacing "erc" dir in /usr/share/emacs), so it is also possible that
maybe some change in Emacs 29+ prevents this behavior, but it seems unlikely.


Thanks.

-- 
Mike Kazantsev // fraggod.net





reply via email to

[Prev in Thread] Current Thread [Next in Thread]