incubator-ponymail
incubator-ponymail copied to clipboard
AAA regression in notifications API
notifications.lua looks for notifications, and if AAA is enabled, tries to parse list-id which requires a list_raw element present. As that isn't set in archiver.py, it causes a nil error.
Three possible ways of fixing:
- fall back to using the
listelement if no list_raw exists (easiest, and best for backwards compat) - have archiver also add a
list_rawto notifications - don't copy the email into the notifications db, but rather have a reference to the mbox document
According to the setup.py code, the notifications doc type is not set up with the list_raw attribute, which is presumably why the archiver does not try to populate it when saving the notifications.
However, lists.a.o does populate the list_raw field for private emails (presumably the code that handles private mails is using a different version of the archiver).
This may explain why the bug has only recently been noticed. (In my case, I only recently used the reply function for a public list reply)
The simplest fix would be for notifications.lua to unconditionally populate list_raw from list. I don't see the point in checking to see if list_raw already exists.
I'm not sure it's worth changing the notifications doc type to keep only a reference to the mbox document. That would mean fetching the mbox entry in order to check access.