Folder deletion problem (Re: Problem with imap resource)

David Faure faure at kde.org
Fri Jan 13 09:53:29 GMT 2017


On vendredi 13 janvier 2017 10:37:08 CET Daniel Vrátil wrote:
> Indeed, this is broken. This is actually broken more than you think, with no
> easy way to fix it completely. It's possible that it worked previously
> simply because maybe an item change event in the collection just before
> removal (maybe triggered when you opened the folder and KMail selected an
> email in there) caused the CollectionCache to be populated. 

The folders are empty, in my case. So there is no email to select.
But yeah it was broken even for non-empty folders IIRC.

> Attached is a patch that should fix it a little, please give it a try. 

It has one ')' too many at the end, but apart from that, IT WORKS.

I'm finally able to clean up the many empty folders I accumulated recently
(to test the DnD crash I fixed, and then due to moving to a different imap 
server).

Can you push the fix after s/))/)/? Thanks.

> The bigger problem is when you delete a Collection with sub-collections. The
> server will emit the notifications starting with the outter-most
> collections going back to the parent you actually removed, but by the time
> the notification about the leaf collection gets to a Monitor in a client
> and the Monitor requests its parent collection, the parent collection might
> not longer exist either in the server either and then it fails again.
> 
> The only real fix for all these problems is Notification Payloads, i.e.
> sending the actual changed entities as part of the notification instead of
> Monitor retrieving them. That's the only way to correctly "snapshot" the
> state of things at the time the notification was created (and it does
> improve performance quite a bit). Maybe I should move it up on my todo list
> again...but for now this patch should fix the most immediate problem.

I see. Yes, not knowing the implementation details, I actually expected the 
information to be sent rather than retrieved...

Naively I expected the server to directly trigger "commands" in ResourceBase,
I had no idea this went through Monitor also on the resource side.
But well, I'm more used to the KIO design than to the Akonadi design :-)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5




More information about the kde-pim mailing list