Summary: | Expiry settings not displayed properly from Akonadi config | ||
---|---|---|---|
Product: | [Applications] kmail2 | Reporter: | Thiago Macieira <thiago> |
Component: | folders | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | grave | CC: | montel |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/pim/mailcommon/commit/6ed6903a8b6b78869e60a2aab91ed997e6c9bf31 | Version Fixed In: | 5.18.0 |
Sentry Crash Report: |
Description
Thiago Macieira
2021-08-02 15:44:23 UTC
This is a DATA LOSS issue for me. If I don't move emails from certain folders before a deadline, they get removed. This used to work a few weeks ago. It might have been a recent update that caused this issue. It seems that it works here. Which is the version ? In akonadiconsole, checking the properties of the folder in question, the Attributes tab has a "expirationcollectionattribute", but it's empty. That confirms the "not saving" part. (In reply to Laurent Montel from comment #2) > It seems that it works here. > Which is the version ? $ kmail --version kmail2 5.17.3 (21.04.3) $ akonadictl --version akonadictl 5.17.3 (21.04.3) MariaDB [akonadi]> select type, hex(value) from collectionattributetable where type='expirationcollectionattribute'; +-------------------------------+--------------------------------------------------------------+ | type | hex(value) | +-------------------------------+--------------------------------------------------------------+ | expirationcollectionattribute | FFFFFFFFFFFFFFFF000000000000000100000078000000000000001E0100 | | expirationcollectionattribute | FFFFFFFFFFFFFFFF00000000000000010000016D000000000000001E0100 | | expirationcollectionattribute | 00000000000000F500000001000000010000001E000000000000001E0100 | | expirationcollectionattribute | 00000000000000F6000000010000000100000015000000000000001E0100 | +-------------------------------+--------------------------------------------------------------+ 4 rows in set (0.001 sec) (In reply to Thiago Macieira from comment #5) > MariaDB [akonadi]> select type, hex(value) from collectionattributetable > where type='expirationcollectionattribute'; > +-------------------------------+-------------------------------------------- > ------------------+ > | type | hex(value) > | > +-------------------------------+-------------------------------------------- > ------------------+ > | expirationcollectionattribute | > FFFFFFFFFFFFFFFF000000000000000100000078000000000000001E0100 | > | expirationcollectionattribute | > FFFFFFFFFFFFFFFF00000000000000010000016D000000000000001E0100 | > | expirationcollectionattribute | > 00000000000000F500000001000000010000001E000000000000001E0100 | > | expirationcollectionattribute | > 00000000000000F6000000010000000100000015000000000000001E0100 | > +-------------------------------+-------------------------------------------- > ------------------+ > 4 rows in set (0.001 sec) Given: QByteArray ExpireCollectionAttribute::serialized() const { QByteArray result; QDataStream s(&result, QIODevice::WriteOnly); s << mExpireToFolderId; s << (int)mExpireAction; s << (int)mReadExpireUnits; s << mReadExpireAge; s << (int)mUnreadExpireUnits; s << mUnreadExpireAge; s << mExpireMessages; return result; } Decode as: Read messages Unread mesgs FolderId Action Units ReadAge Units Age ExpireMessages -1 0 1 120 0 30 true -1 0 1 365 0 30 true 245 1 1 30 0 30 true 246 1 1 21 0 30 true So I have 4 folders with expiry settings. Two of them delete (target folder ID is -1) and two of them move to another folder. The settings appear to be correct. This is indeed what I had configured. But the settings page is not reloading the settings. > But the settings page is not reloading the settings.
I've just made a change to one of the folders to expire unread emails too. The MySQL database reflects the change:
MariaDB [akonadi]> select type, hex(value) from collectionattributetable where type='expirationcollectionattribute';
+-------------------------------+--------------------------------------------------------------+
| type | hex(value) |
+-------------------------------+--------------------------------------------------------------+
| expirationcollectionattribute | FFFFFFFFFFFFFFFF000000000000000100000078000000000000001E0100 |
| expirationcollectionattribute | FFFFFFFFFFFFFFFF00000000000000010000016D000000000000001E0100 |
| expirationcollectionattribute | 00000000000000F500000001000000010000001E000000010000001E0100 |
| expirationcollectionattribute | 00000000000000F6000000010000000100000015000000000000001E0100 |
+-------------------------------+--------------------------------------------------------------+
4 rows in set (0.001 sec)
See the "1" in the third line, for the expiration of unread emails too.
After making this change, KMail / Akonadi does display the modified settings for this folder.
(In reply to Thiago Macieira from comment #7) > After making this change, KMail / Akonadi does display the modified settings > for this folder. Looks like the setting does get reloaded properly if the expiry for unread messages is activated. The moment I turn it off again, the setting is not displayed properly on the Expiry tab. Git commit 6ed6903a8b6b78869e60a2aab91ed997e6c9bf31 by Laurent Montel. Committed on 03/08/2021 at 05:20. Pushed by mlaurent into branch 'release/21.08'. Fix Bug 440524 - Expiry settings not displayed properly from Akonadi config FIXED-IN: 5.18.0 (loading was incorrect: - settings.mUnreadExpireUnits = attr->readExpireUnits(); - settings.mReadExpireUnits = attr->unreadExpireUnits(); + settings.mUnreadExpireUnits = attr->unreadExpireUnits(); + settings.mReadExpireUnits = attr->readExpireUnits(); ) M +2 -2 src/collectionpage/collectionexpirypage.cpp M +20 -0 src/collectionpage/collectionexpirywidget.cpp M +2 -6 src/collectionpage/collectionexpirywidget.h https://invent.kde.org/pim/mailcommon/commit/6ed6903a8b6b78869e60a2aab91ed997e6c9bf31 |