[Kde-pim] Checking for valid folder names in Akonadi

Thomas McGuire mcguire at kde.org
Fri May 28 12:56:03 BST 2010


Hi,

On Friday 28 May 2010 06:16:08 Tobias Koenig wrote:
> On Thu, May 27, 2010 at 10:44:23PM +0200, Thomas McGuire wrote:
> > So in slotCreateCollection() of the standard action manager we should
> > check this and show a nice error dialog if the folder name is invalid.
> > Same when changing the folder name with the folder properties dialog.
> > The question is: How? A valid file name is resource-specific, especially
> > in the IMAP case, the folder seperator can apparently be
> > server-specific, KMail 1 had methods like delimiterForFolder() for this.
> 
> Exactly, it's the task of the resource to handle this inside
> ResourceBase::collectionCreated() and ResourceBase::collectionChanged().
> We just have to handle the return values of all the Jobs correctly and
> finally find a way to propagate back errors inside the resource to the
> server and user. That's the right way to fix it.
> 
> Adding such a check on client side will former or later cause other issues,
> we had situations like that several times already... :(

However, the usecase here is that we should show the error to the user 
immediately if possible. It would be very strange if the user creates a folder 
with forbidden letters, clicks Ok, and the folder will be created, but some 
seconds later, an error message will be shown (well, actually, errors are 
probably ignored currently), and the folder is still there... Because of the 
asynchronous nature of Akonadi and because agents can be offline, there is not 
really a good way to solve this.

This is why I think we should check the folder names on the client side, to 
prevent that strange limbo state where the collection is valid on the Akonadi 
server but not valid on the resource side.

This is what KMail 1 did: It checked folder names upon creation, and should 
another error during sync occur, it would simply show an error message and 
leave the folder in a limbo state.

We also really have to do something about the asynchronous error handling: 
Currently, the resource emits error(), but nobody listens to it. So the user 
is never informed about the error, and thinks his folder is valid...

Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100528/7a1fe7a7/attachment.sig>
-------------- next part --------------
_______________________________________________
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