Bug 255465 - Deleting a folder containing a subfolder does not work
Summary: Deleting a folder containing a subfolder does not work
Status: CLOSED FIXED
Alias: None
Product: KMail Mobile
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Kevin Ottens
URL:
Keywords:
: 253240 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-28 01:28 UTC by Sabine Faure
Modified: 2010-12-23 23:12 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch that fixes recursive folder deletion (9.28 KB, patch)
2010-12-14 08:34 UTC, Tobias Koenig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sabine Faure 2010-10-28 01:28:09 UTC
Version:           unspecified (using Devel) 
OS:                Linux

Deleting a folder that contain a subfolder as well as the emails they contain does not seem to work atm.

Reproducible: Always

Steps to Reproduce:
- Launch Kmail-mobile
- Click on your Imap inbox
- Select an already existing folder containing two emails (ex Folder 2) and copy it into another one also containing 2 emails (ex: folder 1) still within the Imap inbox
- Select folder 1
- Open the 'Actions' tab
- Click on 'Edit'
- Click on 'Delete folder'
- A 'Delete folder?' pop up message appears asking: 'Do you really want to delete this folder and all its sub-folders?'
- Click on 'Delete'
- the Folder view goes back to the Imap server name
- Click on your Imap inbox

Actual Results:  
Folder 1 is still displayed but does not contain any email anymore.

Its subfolder (Folder 2) is still displayed too and still contains both its emails.

Expected Results:  
Both Folder 1 and 2 as well as their emails should be properly deleted.

Note: if 'Folder 2' does not display any email after deleting 'Folder 1' try quitting and then relaunching Kmail-mobile.

N900, 4:4.6~20101026.1190044-1maemo1.1189579
Comment 1 Bjoern Ricks 2010-11-01 12:32:16 UTC
*** Bug 253240 has been marked as a duplicate of this bug. ***
Comment 2 Tobias Koenig 2010-12-10 14:57:18 UTC
This is a problem of the Akonadi server, which does not send remote ids for the anchestor hierarchy. Therefor resources with hierarchical remote identifiers (e.g. the imap resource) can't find the object to delete in the backend.

@Volker any idea how to fix this?
Comment 3 Tobias Koenig 2010-12-14 08:34:31 UTC
Created attachment 54539 [details]
Patch that fixes recursive folder deletion

This patch introduces a new class RemoveCollectionRecursiveTask, which deletes a complete folder hierarchy recursively. The resource ignores now itemRemoved()/collectionRemoved() calls for items/collections with parent collections without remote identifier and does a recursive deletion of the uppermost collection to remove.
Comment 4 Tobias Koenig 2010-12-20 17:02:50 UTC
SVN commit 1208084 by tokoe:

Delete a collection recursive

Since Akonadi server does not support hierarchical remote
identifiers in delete notifications, we have to ignore the notifications
for child collections/items and remove the requested imap folder recursivly
on the IMAP server.

BUG: 255465


 M  +1 -0      CMakeLists.txt  
 M  +18 -1     imapresource.cpp  
 A             removecollectionrecursivetask.cpp   [License: LGPL (v2+)]
 A             removecollectionrecursivetask.h   [License: LGPL (v2+)]
 M  +112 -0    tests/testremovecollectiontask.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1208084
Comment 5 Sabine Faure 2010-12-20 21:46:24 UTC
My revision is not recent enough to test this bug so I'll retest it later this week.

N900,4:4.6~20101220.1208001-1maemo1.1206430
Comment 6 Sabine Faure 2010-12-22 22:16:18 UTC
Could not retest today due to a regression (see bug #261006)

N900, 4:4.6~20101222.1208531-1maemo1.1208558
Comment 7 Sabine Faure 2010-12-23 23:12:11 UTC
It is corrected now.

Both the folder and its subfolder are deleted properly as well as their emails so I am closing this bug.

N900, 4:4.6~.20101223.2034.git9cc0c3e-1maemo1.120883