[Kde-pim] Data loss: kmail2 must not use existing [Folder-xy] settings on random new folders

Sven Burmeister sven.burmeister at gmx.net
Tue Dec 13 09:32:55 GMT 2011


Let's start anew.

Removing akonadi's database must not lose any emails in any way.

Kmail is not an client for akonadi but currently the client.

Removing the database resets unique-IDs. Because their uniqueness does not 
rely on chance of re-occurence but database internals.

Any client storing information cannot know whether akonadi has reset its 
database. This is a design-flaw IMHO if the ID is used to communicate.

Akonadi's unique-IDs are only unique for its database and not across the 
system. They do not even try to, yet are used outside akonadi.

Using these IDs outside akonadi is not robust, yet they are used outside 
causing data loss.

To reproduce:

1. set some of your folders with expiration in kmail
2. close kmail
3. remove your akonadi database (it could have get corrupted, it might have 
grown too big, you name it, removing it must not lose any email.)
3. after you did so, restart akonadi and re-add your resources
4. start kmail
5. lose data

According to what you wrote there is no way kmail can know that the akonadi db 
was reset and thus it must assume that it can continue to use its settings for 
any ID it has stored.

This is neither failsafe nor robust.

What would make it more robust:

Use only IDs to communicate with clients that are "guaranteed" to be unique 
for akonadi _and_ the client, i.e. rely on chance of re-occurrence like 
message-IDs.

Generate a unique ID when creating a new akonadi database and require clients 
to check that ID every time they connect to akonadi. That way any client can 
compare the ID/db its settings apply to and remove them if a new database was 
created.

Please do not assume that removing akonadi's database is a corner case.
Neither is it a corner case that clients store settings and rely on the 
"unique" ID they got from akonadi, which is only unique as long as akonadi is 
not reset.

Sven
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list