GNU bug report logs - #20319
nnoo.el not properly restoring back end server state

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs,gnus; Reported by: Alain Schneble <a.s@HIDDEN>; dated Mon, 13 Apr 2015 20:29:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 20319 <at> debbugs.gnu.org:


Received: (at 20319) by debbugs.gnu.org; 12 Apr 2018 21:11:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 12 17:11:58 2018
Received: from localhost ([127.0.0.1]:48633 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f6jVe-0003nL-8F
	for submit <at> debbugs.gnu.org; Thu, 12 Apr 2018 17:11:58 -0400
Received: from hermes.netfonds.no ([80.91.224.195]:39222)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1f6jVc-0003nD-I8
 for 20319 <at> debbugs.gnu.org; Thu, 12 Apr 2018 17:11:57 -0400
Received: from 46.67.12.60.tmi.telenormobil.no ([46.67.12.60] helo=corrigan)
 by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <larsi@HIDDEN>)
 id 1f6jVZ-0001MR-J2; Thu, 12 Apr 2018 23:11:55 +0200
Received: from larsi by corrigan with local (Exim 4.89)
 (envelope-from <larsi@HIDDEN>)
 id 1f6jVJ-0006WM-GE; Thu, 12 Apr 2018 23:11:37 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Alain Schneble <a.s@HIDDEN>
Subject: Re: bug#20319: nnoo.el not properly restoring back end server state
References: <86r3rng4gy.fsf@HIDDEN> <877f5hzotn.fsf@HIDDEN>
 <867f5hlhoq.fsf@HIDDEN>
Date: Thu, 12 Apr 2018 23:11:37 +0200
In-Reply-To: <867f5hlhoq.fsf@HIDDEN> (Alain Schneble's message of "Thu, 26
 Jan 2017 20:55:33 +0100")
Message-ID: <874lkggmeu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20319
Cc: 20319 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alain Schneble <a.s@HIDDEN> writes:

>>> Also, I do not understand why nil server's data is stored (re-pushed)
>>> onto the nnoo-state-alist by nnoo-push-server at all.  My understanding
>>> is that nil server's data shall be immutable once it's been initialized.
>>>
>>> But I might be wrong.  What's the use case of re-pushing nil server's data?
>>
>> I think you're right, but I haven't looked at the code closely.  Could
>> you suggest a patch to fix this problem, perhaps?
>
> Sure, I'll arrange a patch.  Please, just give me a few days...

It's now been a few days.  :-) Did you whip up a patch in the meantime?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#20319; Package emacs,gnus. Full text available.

Message received at 20319 <at> debbugs.gnu.org:


Received: (at 20319) by debbugs.gnu.org; 26 Jan 2017 19:56:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 26 14:56:47 2017
Received: from localhost ([127.0.0.1]:46082 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cWq9z-0006RQ-JT
	for submit <at> debbugs.gnu.org; Thu, 26 Jan 2017 14:56:47 -0500
Received: from clientmail.realize.ch ([46.140.89.53]:1572)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alain.schneble@HIDDEN>) id 1cWq9u-0006R9-CA
 for 20319 <at> debbugs.gnu.org; Thu, 26 Jan 2017 14:56:42 -0500
Received: from rintintin.hq.realize.ch.lan.rit (Unknown [192.168.0.105])
 by clientmail.realize.ch with ESMTPA
 ; Thu, 26 Jan 2017 20:56:15 +0100
Received: from myngb (192.168.66.65) by rintintin.hq.realize.ch.lan.rit
 (192.168.0.105) with Microsoft SMTP Server (TLS) id 15.0.516.32; Thu, 26 Jan
 2017 20:55:48 +0100
From: Alain Schneble <a.s@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#20319: nnoo.el not properly restoring back end server state
References: <86r3rng4gy.fsf@HIDDEN> <877f5hzotn.fsf@HIDDEN>
Date: Thu, 26 Jan 2017 20:55:33 +0100
In-Reply-To: <877f5hzotn.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 26 Jan 2017 18:57:40 +0100")
Message-ID: <867f5hlhoq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-ClientProxiedBy: rintintin.hq.realize.ch.lan.rit (192.168.0.105) To
 rintintin.hq.realize.ch.lan.rit (192.168.0.105)
X-Spam-Score: -3.2 (---)
X-Debbugs-Envelope-To: 20319
Cc: 20319 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.2 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Sorry for the late response; due to a misunderstanding the Gnus bug
> reports went to a part of the bug tracker I wasn't checking.

No problem at all.  Thanks for bringing this up.

> Alain Schneble <a.s@HIDDEN> writes:
>
>> Anyway, evaluating nnoo-state-alist again shows that server's B state
>> would still be available but is not found because it's listed before nil
>> server's data:
>> => (... (nntp nil ("B" (nntp-address . "news.gnus.org") ...) (nil (nntp-address) ...)) ...)
>>
>> IIUC, this behavior is wrong.
>>
>> Also, I do not understand why nil server's data is stored (re-pushed)
>> onto the nnoo-state-alist by nnoo-push-server at all.  My understanding
>> is that nil server's data shall be immutable once it's been initialized.
>>
>> But I might be wrong.  What's the use case of re-pushing nil server's data?
>
> I think you're right, but I haven't looked at the code closely.  Could
> you suggest a patch to fix this problem, perhaps?

Sure, I'll arrange a patch.  Please, just give me a few days...

Alain





Information forwarded to bug-gnu-emacs@HIDDEN, bugs@HIDDEN:
bug#20319; Package emacs,gnus. Full text available.
bug No longer marked as found in versions 5.13. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug reassigned from package 'gnus' to 'emacs,gnus'. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 20319 <at> debbugs.gnu.org:


Received: (at 20319) by debbugs.gnu.org; 26 Jan 2017 18:11:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 26 13:11:19 2017
Received: from localhost ([127.0.0.1]:45855 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cWoVx-0005P6-Kx
	for submit <at> debbugs.gnu.org; Thu, 26 Jan 2017 13:11:19 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:55849)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1cWoVt-0005Ow-A0
 for 20319 <at> debbugs.gnu.org; Thu, 26 Jan 2017 13:11:16 -0500
Received: from 2.150.50.220.tmi.telenormobil.no ([2.150.50.220] helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <larsi@HIDDEN>)
 id 1cWoVm-0004KI-9h; Thu, 26 Jan 2017 19:11:12 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Alain Schneble <a.s@HIDDEN>
Subject: Re: bug#20319: nnoo.el not properly restoring back end server state
In-Reply-To: <86r3rng4gy.fsf@HIDDEN> (Alain Schneble's message of "Mon, 13
 Apr 2015 22:26:05 +0200")
Date: Thu, 26 Jan 2017 18:57:40 +0100
Message-ID: <877f5hzotn.fsf@HIDDEN>
References: <86r3rng4gy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20319
Cc: 20319 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Sorry for the late response; due to a misunderstanding the Gnus bug
reports went to a part of the bug tracker I wasn't checking.

Alain Schneble <a.s@HIDDEN> writes:

> Anyway, evaluating nnoo-state-alist again shows that server's B state
> would still be available but is not found because it's listed before nil
> server's data:
> => (... (nntp nil ("B" (nntp-address . "news.gnus.org") ...) (nil (nntp-address) ...)) ...)
>
> IIUC, this behavior is wrong.
>
> Also, I do not understand why nil server's data is stored (re-pushed)
> onto the nnoo-state-alist by nnoo-push-server at all.  My understanding
> is that nil server's data shall be immutable once it's been initialized.
>
> But I might be wrong.  What's the use case of re-pushing nil server's data?

I think you're right, but I haven't looked at the code closely.  Could
you suggest a patch to fix this problem, perhaps?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bugs@HIDDEN:
bug#20319; Package gnus. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Apr 2015 20:28:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 13 16:28:43 2015
Received: from localhost ([127.0.0.1]:55223 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YhkyE-0004LO-Nt
	for submit <at> debbugs.gnu.org; Mon, 13 Apr 2015 16:28:43 -0400
Received: from clientmail.realize.ch ([46.140.89.53]:1722)
 by debbugs.gnu.org with smtp (Exim 4.80)
 (envelope-from <alain.schneble@HIDDEN>) id 1YhkwV-0004Ib-Vq
 for submit <at> debbugs.gnu.org; Mon, 13 Apr 2015 16:26:57 -0400
Received: from rintintin.hq.realize.ch.lan.rit ([192.168.0.105])
 by clientmail.realize.ch ; Mon, 13 Apr 2015 22:26:37 +0200
Received: from MYTGB (192.168.66.64) by rintintin.hq.realize.ch.lan.rit
 (192.168.0.105) with Microsoft SMTP Server (TLS) id 15.0.516.32; Mon, 13 Apr
 2015 22:26:26 +0200
From: Alain Schneble <a.s@HIDDEN>
To: The Gnus Bugfixing Girls + Boys <submit <at> debbugs.gnu.org>
Subject: nnoo.el not properly restoring back end server state
X-Debbugs-Version: 5.13
X-Debbugs-Package: gnus
Date: Mon, 13 Apr 2015 22:26:05 +0200
Message-ID: <86r3rng4gy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-ClientProxiedBy: rintintin.hq.realize.ch.lan.rit (192.168.0.105) To
 rintintin.hq.realize.ch.lan.rit (192.168.0.105)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 13 Apr 2015 16:28:36 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi,

nnoo.el does not properly restore back end server state from
nnoo-state-alist after closing one server (say server A) and reopening
another (say server B), given that both servers use the same back end
(server method). Cached state of server B won't be restored at all in
this case.

Steps to reproduce:

1. M-x gnus-other-frame
2. M-x gnus-group-enter-server-mode
3. For each server: M-x gnus-server-close-server
4. Repeat twice, once with [server] = A and once with [server] = B:
   a) M-x gnus-server-add-server
   b) nntp
   c) [server]
   d) M-x gnus-server-edit-server
   e) Adapt shown elisp form to:
      (nntp "[server]" (nntp-address "news.gnus.org"))
   f) C-c C-c
5. On server A: M-x gnus-server-open-server
6. On server B: M-x gnus-server-open-server
7. On server A: M-x gnus-server-close-server

Evaluating nnoo-state-alist at this point reveals that no current server
is set and that server's B state is properly stored:
=> (... (nntp nil (nil (nntp-address) ...) ("B" (nntp-address . "news.gnus.org") ...)) ...)

8. Set a breakpoint in nnoo.el's nnoo-change-server defun.
9. On server B: M-x gnus-server-read-server
10. Breakpoint should be hit.
11. Observe that after calling (nnoo-push-server backend current)
    the nil server's data is now at the end of the nntp list in
    nnoo-state-alist.
12. Observe that just after the nnoo-push-server call, the
    (setq state ...) will be initialized from (nnoo-variables-backend),
    as the (cdr (assoc server (cddr bstate))) in the (or ...) returns
    nil. The (cddr bstate) jumps over server's "B" data by mistake.
    
    Does this code assume that nil server's data should always come
    before any other server's data in the back end's entry in
    nnoo-state-alist?  Or I assume it should just evaluate (cdr bstate)
    instead of (cddr bstate) at this place.

Anyway, evaluating nnoo-state-alist again shows that server's B state
would still be available but is not found because it's listed before nil
server's data:
=> (... (nntp nil ("B" (nntp-address . "news.gnus.org") ...) (nil (nntp-address) ...)) ...)

IIUC, this behavior is wrong.

Also, I do not understand why nil server's data is stored (re-pushed)
onto the nnoo-state-alist by nnoo-push-server at all.  My understanding
is that nil server's data shall be immutable once it's been initialized.

But I might be wrong.  What's the use case of re-pushing nil server's data?

        Alain


Gnus v5.13
GNU Emacs 24.4.1 (i686-pc-mingw32)
 of 2014-10-24 on LEG570





Acknowledgement sent to Alain Schneble <a.s@HIDDEN>:
New bug report received and forwarded. Copy sent to bugs@HIDDEN. Full text available.
Report forwarded to bugs@HIDDEN:
bug#20319; Package gnus. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 12 Apr 2018 21:15:02 UTC

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