GNU bug report logs - #52010
28.0.60; ERC now ignores dialed server names in autojoin

Previous Next

Package: emacs;

Reported by: "J.P." <jp <at> neverwas.me>

Date: Sun, 21 Nov 2021 00:16:02 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

Fixed in version 28.1

Done: "J.P." <jp <at> neverwas.me>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52010 in the body.
You can then email your comments to 52010 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52010; Package emacs. (Sun, 21 Nov 2021 00:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "J.P." <jp <at> neverwas.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 21 Nov 2021 00:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: bug-gnu-emacs <at> gnu.org
Cc: emacs-erc <at> gnu.org
Subject: 28.0.50; ERC now ignores dialed server names in autojoin
Date: Sat, 20 Nov 2021 16:15:24 -0800
[Message part 1 (text/plain, inline)]
Tags: patch

A recent addition [1] to ERC (and now Emacs 28) introduced a breaking
change that's set to create some churn for (what I suspect will be) a
noticeable swath of ERC users. First off, this is solely my fault
because I advocated for this addition without envisioning, much less
trying to forestall, the coming disruption [2].

What this boils down to is that folks with an entry like
("irc.libera.chat" "#libera") in their `erc-autojoin-channels-alist'
will find that it no longer works because ERC now matches against what's
called the "announced" name (e.g., "foo.libera.chat") rather than the
"dialed" name ("irc.libera.chat" or "localhost" or "my.vps.net") [3].

Anyway, apologies for the delay in bringing this to the tracker [4]. The
attached patch attempts to right the offending portions while preserving
the benefits introduced by [1], which I still believe to be significant.
Please direct your daggers toward me and not [1]'s author. Thanks.

P.S. Tests for this reside in #48598.


Notes
~~~~~

[1] commit 9bb8d90cddf11df3aecdc6c04e762773dfa0cb92
    Allow irc network symbols in erc-autojoin-channels-alist

[2] I suppose I've been so preoccupied with whining about the underlying
    problem this exposes (mostly in my progress reports for #48598) that
    I neglected to confront the reality of [1] becoming the last word on
    join-related business for a good while. IOW, having #48598's patch
    set build on [1]'s changes while believing wholeheartedly that both
    would make it into 28 was classic hubris on my part in that it drove
    me to "forget" to consider what would happen if the two ever found
    themselves on opposite sides of a release divide. Which they have.

[3] In reality, "announced" is favored only when set, which is basically
    always because the 004 handler runs right on the heels of connection
    registration. For anyone who cares, kensanata added the fallback in
    2005, right around when `erc-announced-server-name' became
    `erc-server-announced-name'.

    BTW, this new reorienting toward the "announced" name isn't actually
    the focus of [1], which is more about elevating network names to
    equal footing. And it isn't really "new" at all but more like a
    restoration of what's historically been the preferred (and, from
    2001 to 2005, only) means of referring to an IRC session. Only in
    the last few years or so has ERC actually been conflicted in this
    regard.

[4] For a couple weeks now, I've been trying to reach out to the person
    who initially brought this to our attention on Libera, but that's
    become a lost cause. I mainly wanted to confirm that their
    suspicions of this being an Emacs-29-only thing were in fact wrong,
    which I'm now certain of.


In GNU Emacs 29.0.50 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)
 of 2021-11-18 built on localhost
Repository revision: 69f1bc43c026049ed2aab6a6368e2e9a5406b779
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Fedora 34 (Workstation Edition)

Configured using:
 'configure --enable-check-lisp-object-type --enable-checking=yes,glyphs
 --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu
 --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin
 --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share
 --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec
 --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no --with-xwidgets --with-modules --with-harfbuzz
 --with-cairo --with-json build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-O0 -g3'
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
WEBP X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media rmc puny
dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json map
text-property-search time-date seq gv subr-x byte-opt bytecomp
byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode cl-loaddefs cl-lib iso-transl
tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget keymap hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
x multi-tty make-network-process emacs)

Memory information:
((conses 16 53474 6237)
 (symbols 48 6794 1)
 (strings 32 19269 1625)
 (string-bytes 1 642335)
 (vectors 16 14025)
 (vector-slots 8 189932 12509)
 (floats 8 22 37)
 (intervals 56 262 0)
 (buffers 992 10))
[0002-Fall-back-on-dialed-server-names-in-erc-join.patch (text/x-patch, attachment)]

Changed bug title to '28.0.60; ERC now ignores dialed server names in autojoin' from '28.0.50; ERC now ignores dialed server names in autojoin' Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Sun, 21 Nov 2021 01:33:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52010; Package emacs. (Sun, 21 Nov 2021 11:32:02 GMT) Full text and rfc822 format available.

Message #10 received at 52010 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 52010 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#52010: 28.0.60; ERC now ignores dialed server names in
 autojoin
Date: Sun, 21 Nov 2021 03:31:03 -0800
[Message part 1 (text/plain, inline)]
v2: a small tweak to leave a tidier footprint for git-blame.


Also, some slight corrections on the timeline:


  Jan 20, 2003 - Register autojoin function with `erc-after-connect'
                 hook, which passes in `erc-announced-server-name' for
                 function's server param

  Jun 26, 2005 - Add dialed server as fallback when announced name
                 missing

  Sep 16, 2005 - Deprecate `erc-announced-server-name' in favor of
                 `erc-server-announced-name'

  Jan 05, 2017 - Switch from announced to dialed, ignoring server param
                 provided by `erc-after-connect' hook

  Sep 16, 2021 - Switch from dialed to announced, but consider networks

    This patch - Stay the course, but always fall back to dialed (not
                 just when unset)

    Bug #48598 - Prefer unique session identifiers based around and
                 compatible with networks, but fall back on announced,
                 then dialed (for compatibility)


[0000-v1-v2.diff (text/x-patch, attachment)]
[0001-Fall-back-on-dialed-server-names-in-erc-join.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52010; Package emacs. (Mon, 22 Nov 2021 01:44:01 GMT) Full text and rfc822 format available.

Message #13 received at 52010 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: 52010 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#52010: 28.0.60; ERC now ignores dialed server names in
 autojoin
Date: Sun, 21 Nov 2021 17:43:23 -0800
Actually, please ignore everything stated previously (and the patch as
well).

The 2017 change [1] was *not* the source of the problem as wrongly
implied in my previous email (although it did get the ball rolling by
changing from announced to dialed names for auth-source queries). The
real culprit is actually something way more recent [2]:

  diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
  index e4faf6bd79..79c111082f 100644
  --- a/lisp/erc/erc-join.el
  +++ b/lisp/erc/erc-join.el
  @@ -153,18 +153,20 @@ erc-autojoin-channels
                                'erc-autojoin-channels-delayed
                                server nick (current-buffer))))
       ;; `erc-autojoin-timing' is `connect':
  -    (dolist (l erc-autojoin-channels-alist)
  -      (when (string-match (car l) server)
  -       (let ((server (or erc-session-server erc-server-announced-name)))
  +    (let ((server (or erc-session-server erc-server-announced-name)))
  +      (dolist (l erc-autojoin-channels-alist)
  +        (when (string-match-p (car l) server)

But its damage has already been undone by [3] (IOW, there's no
regression)! So everything's fine as long as we don't mind a bit of
churn for folks on master who may have adjusted their autojoin alists in
the meantime (since August 2020 or so).

I suppose if we *really* wanted to be thorough, we could add an entry to
etc/ERC-NEWS saying a problem introduced in early in Emacs-28
development has been fixed and that any entries in
`erc-autojoin-channels-alist' containing dialed host names as keys
should use networks or partial announced domains instead. But, IMO,
that's unnecessary.

Thanks, and apologies (yet again) for the noise.


[1] commit 927dcbd2e6e0e53fcfb09296716e11c002ab1518
    Fix erc-join with channel password

[2] commit 88567ca8ecb505a59157af6338ebe355a304182b
    Fix erc-reuse-buffers behavior

[3] commit 9bb8d90cddf11df3aecdc6c04e762773dfa0cb92
    Allow irc network symbols in erc-autojoin-channels-alist




bug marked as fixed in version 28.1, send any further explanations to 52010 <at> debbugs.gnu.org and "J.P." <jp <at> neverwas.me> Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Mon, 22 Nov 2021 01:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 Dec 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 89 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.