unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59976: ERC 5.4.1: erc-networks--id gets clobbered in erc server buffer on /query name conflict
@ 2022-12-11 19:00 Mike Kazantsev
  2022-12-12 14:35 ` J.P.
       [not found] ` <87pmcowuzv.fsf@neverwas.me>
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Kazantsev @ 2022-12-11 19:00 UTC (permalink / raw)
  To: 59976; +Cc: emacs-erc

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-16 15:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-11 19:00 bug#59976: ERC 5.4.1: erc-networks--id gets clobbered in erc server buffer on /query name conflict Mike Kazantsev
2022-12-12 14:35 ` J.P.
     [not found] ` <87pmcowuzv.fsf@neverwas.me>
2022-12-12 15:35   ` Mike Kazantsev
     [not found]   ` <20221212203508.3cd44bb6@malediction>
2022-12-13 15:13     ` J.P.
2022-12-15 14:16       ` J.P.
     [not found]       ` <87sfhgn45z.fsf@neverwas.me>
2022-12-15 18:24         ` Mike Kazantsev
     [not found]         ` <20221215232455.4a9c6677@malediction>
2022-12-15 18:45           ` Mike Kazantsev
2022-12-16 15:17           ` J.P.

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).