Subject: Re: bug#33005: 27.0.50; Data loss with Gnus registry

From: Michael Heerdegen <[email-masked]>
Date: Thu, 28 Nov 2019 17:25:29 +0100

Eric Abrahamsen <[email-masked]> writes:

> But that still doesn't completely explain why this works. Say a user
> starts Gnus cold, and only loads gnus-registry.el via an autoloaded call
> to `gnus-registry-initialize' in the init file. The shutdowns run before
> the init file is loaded, meaning gnus-registry.el hasn't been loaded,
> meaning it hasn't had a chance to add its registry-related shutdown yet.
> So we should still be loading the registry with an already-initialized
> `gnus-registry-db', and overwriting the user's existing data.

But that shouldn't be hard to find out with the help of edebug, variable
watchers, etc. - right?

BTW, are you sure that the behavior you see is seen by anyone else?
Could it be that it works just for you because of your setup?

> Obviously the code as it stands should be changed: either I should find
> another way of preventing double loading, or the defvar shouldn't
> initialize the database to anything (I prefer this latter).

Initializing with an empty database cries for this sort of problem.
This should only be done when loading fails because the save file
doesn't exist.  Then the user should be informed that a new empty
database is created.

BTW, what's so problematic with avoiding repeated loading?  Can't you
just use a bool var to remember?

Michael.