[Kde-pim] Review Request 109276: Fixes in IMAP resource folder handling

Sandro Knauß mail at sandroknauss.de
Sun Mar 10 16:04:19 GMT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109276/#review28888
-----------------------------------------------------------



resources/imap/addcollectiontask.cpp
<http://git.reviewboard.kde.org/r/109276/#comment21617>

    missing space after (
    if( [...]



resources/imap/changecollectiontask.cpp
<http://git.reviewboard.kde.org/r/109276/#comment21616>

    missing space after (:
    if( [...]



resources/imap/imapresource.cpp
<http://git.reviewboard.kde.org/r/109276/#comment21618>

    missing space after ( and before )
    void ImapResource::showError( [...] )



resources/imap/tests/dummyresourcestate.cpp
<http://git.reviewboard.kde.org/r/109276/#comment21614>

    missing spaces for if ( [...] )



resources/imap/tests/testremovecollectiontask.cpp
<http://git.reviewboard.kde.org/r/109276/#comment21615>

    missing space before ):
    -> connect( task, SIGNAL(destroyed(QObject*)), &loop, SLOT(quit()) );


- Sandro Knauß


On March 3, 2013, 10:52 p.m., Andras Mantia wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109276/
> -----------------------------------------------------------
> 
> (Updated March 3, 2013, 10:52 p.m.)
> 
> 
> Review request for KDEPIM and Kevin Ottens.
> 
> 
> Description
> -------
> 
> We discovered several issues with the IMAP resource folder handling. This patch addresses them, although in some cases with a temporarly solution:
> 
> 1) Creation of toplevel folders created folders with weird remote ids. E.g when creating folder "foo", it set the remoteid to "ifoo". This was because AddCollectionTask sets the first char of the remoteId for new collections based on the first character of the remoteId of the parent collection. For toplevel collections this is "i" from "imap://"... This breaks everything created below this folder as well. Now it is hardcoded to "/", although this will break for IMAP servers using other separators. A nicer solution is needed (finding the right separator is not trivial though). This bug seems to be present also in other tasks as well, but I didn't change as I didn't tested those codepaths.
> 
> 2) Creating toplevel folders requires a resync of the resource for them to appear. This is actually some bug in the ETM that I don't feel like debugging, so a solution used also in other parts of the code is reused: request a resync of the collection list.
> 
> 3) If a folder is created, but it fails (e.g lack of rights on the server), the collection for the folder remains in the akonadi database without a remoteId. This blocks creating of new folders with the same name. I consider that failing to create a folder on the resource's server side is something the user must know and the akonadi cache should reflect the status on the server, I did the following:
> - remove the collection from the cache
> - propagate the error through the status message. This is less then optimal, but afaik there is no other mechanism so far to catch the errors in applications (KMail). Maybe the tracer can be used though?
> 
> 4) Given two folders starting with the same characters (e.g foo and foobar) and deleting "foo" deleted both "foo" and "foobar" because of the wrong startsWith check. Now the folder is deleted, if:
> - it matches the name exactly
> - the found folder is a subolder of the folder that will be deleted (startwith name + separator)
> 
> 5) Deleting of folder was...broken completely. If we had INBOX, foo, bar and tried to deleted e.g bar,  the code started to list the directories, but aborted on the first time when onMailBoxesReceived was called, but the list of mailbox didn't include what we wanted to delete. E.g if the list emitted INBOX, then we aborted without waiting that the slot is called with the rest of the folders. Now we keep track if we found the right folder and abort only if none of the listed folders is what we were expecting.
> 
> 6) Dummyresourcestate unconditionally removed the first char from the mailbox name, so for a collection "foo" it returned "oo" messing the tests up. Now it is slightly more intelligent.
> 
> 7) adapt the test (now the order of deletion calls is different) and fix its synchronization by not using QTest::qWait(), but an event loop to detect when the task finished. This catches (with a deadlock) cases when the task is finished without calling changeProcessed() or cancelTask().
> 
> 
> Diffs
> -----
> 
>   resources/imap/tests/testremovecollectiontask.cpp ba1780b 
>   resources/imap/tests/dummyresourcestate.cpp 518bf8a 
>   resources/imap/removecollectionrecursivetask.cpp 50de4d6 
>   resources/imap/removecollectionrecursivetask.h 361cb0d 
>   resources/imap/imapresource.cpp 8d2332e 
>   resources/imap/imapresource.h 130a337 
>   resources/imap/changecollectiontask.cpp c5ae674 
>   resources/imap/addcollectiontask.cpp d44b98b 
> 
> Diff: http://git.reviewboard.kde.org/r/109276/diff/
> 
> 
> Testing
> -------
> 
> Testing on GMail and the KDAB imap server, running the above unit test (most of the unit tests fail, but I was looking only at this one now).
> 
> 
> Thanks,
> 
> Andras Mantia
> 
>

_______________________________________________
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