From: "J.P." <jp@neverwas.me>
To: acdw <acdw@acdw.net>
Cc: 48598@debbugs.gnu.org, emacs-erc@gnu.org
Subject: bug#48598: Strange ERC/ZNC Bug/Problem
Date: Tue, 07 Sep 2021 14:38:13 -0700 [thread overview]
Message-ID: <87r1e0f4my.fsf__6434.39559951133$1631050758$gmane$org@neverwas.me> (raw)
In-Reply-To: <875yzakzvi.fsf@neverwas.me>
acdw <acdw@acdw.net> writes:
> I'm just going to recount what I experienced using ERC to the best of
> my remembrance; I haven't used it in about a week or so (see the last
> commit of my config using ERC at [1]), having switched to Circe.
Thanks a bunch for this, and apologies for the disappointing experience.
Since you're already an apostate, I'll spare you the annoying followup
questions as well as the customary plea to try out my changes (not that
your initial description wasn't plenty thorough enough).
> - After setting up ZNC on znc.tilde.team, ERC would connect to
> channels on the wrong server, e.g. I had #politics@tilde.team setup,
> it would connect to #politics@libera.chat (which doesn't exist, and
> would redirect to ##politics).
This one is in fact what this entire bug (#48598) is about. On the
surface (at least in your case), the initial blame falls on the autojoin
module, whose flaws any simple half measure might paper over well
enough. But the "confusion" revealed by those flaws runs deeper and
speaks to foundational problems that (IMO) need addressing if ERC is to
remain relevant much longer.
> This is with the new ERC on Emacs 28, that when connecting to
> different servers directly, would /not/ be confused (i.e., two
> buffers were created: “#emacs/tilde.chat”, “#emacs/libera.chat”).
Unfortunately, distinct connections like this aren't immune either. For
example, relinking previously used target buffers can still fail when
endpoints share the same host but different ports.
What's happening in both cases is that ERC makes presumptions about
session semantics based on dialed connection details instead of waiting
for authoritative info to arrive to better inform those decisions. And
for other, truly ambiguous situations, ERC (unlike most clients) doesn't
allow users to declare their intentions upfront but rather insists that
it knows best. Which leads to problems like yours. In ERC's mind, you're
connecting twice to server-network-thingy znc.tilde.team instead of to
networks Libera.Chat and tilde.chat [1].
> To be honest, I'd never used ZNC before either, so it's possible I
> set /that/ up wrong…
ZNC is off the hook here. The problem lies squarely with ERC.
> - Re-connection issues: I'm on a laptop so the connection drops in and
> out. That's not the problem, but ERC was not so smart with
> reconnecting. I'd run /reconnect in a server buffer, or try to map
> the command over servers, and it'd reconnect but my nick would be
> acdw` or similar. I don't think this is ERC's issue /per se/, but
> Circe, e.g., handles it better, afaik.
For this one, I'd have to see some protocol logs before offering
anything of value because a number of factors influence the fate of
reconnection attempts. But just to speculate...
I'm assuming we're talking sans bouncer here (?) because your nick and
authentication status would've remained steady otherwise. I'm also
nixing anything involving client certs [2], based on the config you've
shared. So, ignoring the unlikely possibility you were using auth-source
to supply creds via a repurposed server password [3], I'm going to
assume you were doing the dreaded NickServ dance [4].
But without logs, I can only naively attribute this to some combination
of ERC's rather byzantine reconnect logic [5] and a vague heuristics
failure on the part of the services module in trying to reclaim your
nick. (The smart money's on my being wrong, of course.)
> That's really all I remember, I hope this is helpful. ERC is, on the
> whole, pretty good, and I might switch back later!
Well, if you ever do manage to cast off the spell of that other client
and transmutate back into a disgruntled primate, please take this bug's
proposed changes for a spin [6]. But even if that never happens, the
info you've provided here is very much appreciated. Thanks again.
Notes
~~~~~
[1] If you'll allow me to punctuate that by interjecting with a plug
here for anyone similarly affected: my current patches for this bug
take an aggressive but targeted (meaning still broadly conservative)
approach toward tackling this kind of confusion:
https://jpneverwas.gitlab.io/erc-tools/48598/patches.tar.gz
[2] I mention this because there's an outstanding bug in this area:
https://lists.gnu.org/archive/html/emacs-erc/2021-05/msg00002.html
Gone in [1], FWIW (though likely replaced by dozens more!).
[3] In case you're not familiar, this "PASS user:pwd" convention is a
poor man's SASL-like legacy feature/hack supported by some public
networks. An associated netrc entry might look something like:
machine foo.chat login acdw password acdw:mypass
This matters if I'm wrong (and you *were* attempting to use it)
because it should always succeed on servers that allow it. And it
should do so without any limbo period during which you're not fully
authenticated (its reason for existing, AFAICT).
[4] "Dreaded" in the sense that it's vital to a session's health but
relies on servers acting predictably in areas not governed by any
standard.
For example, `erc-nickserv-identify-on-nick-change' can optionally
attempt to identify you to nick services after receiving a NICK
message confirming the successful granting of your nickname, which
is often the polar opposite of what you want, depending on how your
network is configured. But this isn't currently adjustable per
network; like so many thing ERC, it's all or nothing across the
board.
Similarly, `erc-nickserv-identify-autodetect' runs on NOTICE, but
some IRCds send 433 ERR_NICKNAMEINUSE errors straight away before
even letting you engage nick services. This at least obviates the
need to scrape NOTICEs, but it demands a level of flexibility that
erc-services.el just isn't equipped to offer. Accommodating this
would at the very least involve tweaking how `erc-nickserv-identify'
treats `erc-nickserv-alist-use-nick-p', perhaps by caching the most
recently denied nick for use in the next IDENTIFY message.
Luckily, this is a corner-ish case, and most public networks just
speculatively grant whatever nick you've asked for unless it's
already been taken by another connection, in which case you're met
with that familiar uniquifying backtick (courtesy of the default
433/437 handling). Anyhow, with the world moving on to SASL, the
role of the services module will only continue to diminish. And
that's a good thing, IMO.
[5] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50007
[6] Also available to try in package form (just disregard anything
involving IRCv3):
https://gitlab.com/jpneverwas/erc-v3/-/wikis/home.org
next prev parent reply other threads:[~2021-09-07 21:38 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-23 1:22 28.0.50; buffer-naming collisions involving bouncers in ERC J.P.
2021-06-02 11:19 ` bug#48598: " J.P.
2021-06-09 14:36 ` Olivier Certner
2021-06-10 14:36 ` bug#48598: " J.P.
2021-06-19 3:04 ` J.P.
2021-06-25 13:18 ` J.P.
[not found] ` <87r1gqaxqf.fsf@neverwas.me>
2021-06-28 7:58 ` Olivier Certner
2021-10-16 21:15 ` Daniel Fleischer
2021-10-16 23:21 ` J.P.
[not found] ` <87o87ofte1.fsf@neverwas.me>
2021-11-11 5:24 ` Lars Ingebrigtsen
[not found] ` <8735o39sdg.fsf@gnus.org>
2021-11-11 10:27 ` J.P.
[not found] ` <87pmr77zsa.fsf@neverwas.me>
2021-11-11 12:08 ` Lars Ingebrigtsen
[not found] ` <87a6ia7v47.fsf@gnus.org>
2021-11-11 15:13 ` J.P.
2021-09-04 16:46 ` bug#48598: Strange ERC/ZNC Bug/Problem acdw
2021-09-07 21:38 ` J.P. [this message]
2021-09-10 12:43 ` bug#48598: Duplicate messages from bouncers on 27 and earlier J.P.
2021-11-11 15:15 ` bug#48598: 28.0.50; buffer-naming collisions involving bouncers in ERC J.P.
2022-03-14 13:08 ` J.P.
2022-04-09 21:14 ` bug#48598: Questions regarding layout and composition of tests (bug#48598) J.P.
2022-04-09 21:22 ` bug#48598: Questions regarding auth-source integration (bug#48598) J.P.
[not found] ` <87leweez89.fsf@neverwas.me>
2022-04-10 12:49 ` bug#48598: Questions regarding layout and composition of tests (bug#48598) Lars Ingebrigtsen
[not found] ` <87fsmlp0gy.fsf@gnus.org>
2022-04-11 7:59 ` bug#48598: 28.0.50; buffer-naming collisions involving bouncers in ERC Michael Albinus
[not found] ` <878rsc2gp5.fsf_-_@gmx.de>
2022-04-11 10:21 ` Lars Ingebrigtsen
[not found] ` <878rsbdipd.fsf@gnus.org>
2022-04-11 13:29 ` J.P.
2022-04-11 15:34 ` Lars Ingebrigtsen
2022-04-12 7:50 ` Michael Albinus
[not found] ` <87sfqi2119.fsf@gmx.de>
2022-04-15 13:02 ` J.P.
[not found] ` <87v8vah54l.fsf@neverwas.me>
2022-04-15 15:05 ` Michael Albinus
[not found] ` <87h76ucrq4.fsf@gmx.de>
2022-04-16 1:12 ` J.P.
[not found] ` <87h76tde5k.fsf@neverwas.me>
2022-04-17 8:25 ` Michael Albinus
[not found] ` <87czhgce1s.fsf@gmx.de>
2022-04-18 14:30 ` J.P.
[not found] ` <871qxucvls.fsf@neverwas.me>
2022-04-18 16:43 ` Michael Albinus
[not found] ` <87o80ybauv.fsf@gmx.de>
2022-04-21 13:28 ` J.P.
[not found] ` <87pmlao9ax.fsf@neverwas.me>
2022-04-22 8:54 ` Michael Albinus
[not found] ` <87bkxaeyuw.fsf@neverwas.me>
2022-04-18 13:26 ` bug#48598: Questions regarding auth-source integration (bug#48598) Damien Cassou
2022-04-18 14:24 ` J.P.
[not found] ` <87ee1ucvv3.fsf@neverwas.me>
2022-04-18 15:24 ` Damien Cassou
2022-04-18 16:52 ` Michael Albinus
[not found] ` <87k0bmbage.fsf@gmx.de>
2022-04-20 14:12 ` J.P.
[not found] ` <878rrz268v.fsf@neverwas.me>
2022-04-21 7:08 ` bug#48598: 28.0.50; buffer-naming collisions involving bouncers in ERC Michael Albinus
[not found] ` <87czha3oc5.fsf_-_@gmx.de>
2022-04-21 13:21 ` J.P.
[not found] ` <87v8v2o9l4.fsf@neverwas.me>
2022-04-22 9:29 ` Michael Albinus
[not found] ` <87k0bh31pt.fsf@gmx.de>
2022-04-22 14:24 ` J.P.
[not found] ` <8735i5nql8.fsf@neverwas.me>
2022-04-23 9:47 ` Michael Albinus
[not found] ` <87bkws2ksn.fsf@gmx.de>
2022-04-25 12:05 ` J.P.
[not found] ` <87czh5z7ui.fsf@neverwas.me>
2022-04-27 12:28 ` Michael Albinus
[not found] ` <874k2epv5n.fsf@gmx.de>
2022-04-28 8:08 ` Michael Albinus
[not found] ` <87levpmxz1.fsf@gmx.de>
2022-04-28 8:13 ` Michael Albinus
2022-04-29 13:03 ` J.P.
2022-05-25 19:29 ` J.P.
2022-05-26 5:17 ` J.P.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='87r1e0f4my.fsf__6434.39559951133$1631050758$gmane$org@neverwas.me' \
--to=jp@neverwas.me \
--cc=48598@debbugs.gnu.org \
--cc=acdw@acdw.net \
--cc=emacs-erc@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.