After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 593882 - Ghost mails seen in Anjal Trash folder
Ghost mails seen in Anjal Trash folder
Status: RESOLVED OBSOLETE
Product: evolution-data-server
Classification: Platform
Component: Mailer
2.30.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Yan Li
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2009-09-02 07:08 UTC by Yan Li
Modified: 2015-06-22 06:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot shows a ghost mail in Trash folder (22.82 KB, image/png)
2009-09-02 07:08 UTC, Yan Li
  Details
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anja.patch (2.28 KB, patch)
2009-09-02 07:14 UTC, Yan Li
needs-work Details | Review
Patch: vee_rebuild_folder() code cleanup and adding comments (3.54 KB, patch)
2009-09-02 07:42 UTC, Yan Li
committed Details | Review
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anjal-v2.patch (2.51 KB, patch)
2009-09-03 10:11 UTC, Yan Li
none Details | Review
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anjal-v3.patch (3.46 KB, patch)
2009-09-21 09:25 UTC, Yan Li
rejected Details | Review

Description Yan Li 2009-09-02 07:08:19 UTC
Created attachment 142298 [details]
screenshot shows a ghost mail in Trash folder

This bug appears in Anjal but roots in EDS so I report it here. It was first
reported at Moblin Bugzilla: http://bugzilla.moblin.org/show_bug.cgi?id=5819

Build Image(yyyy-mm-dd): anjal git tip, evolution-data-server git tip

Bug detailed descriptions(behavior, impact, etc)
===========================================================
On my machine there were some ghost mails shown in mail folder tree, but can't
be listed in Trash mail view tab, as you can see in the screenshot. There was 1
unread mail in Trash folder but the Trash tab was empty. How camel reached this
situation is still unknown. I have used it heavily for some days and saw this
occur.

Those mails vuids can be seen in './#evolution/Trash' table and they point to
undeleted mails in Inbox. They are not deleted, and that's why they are not
listed.

When camel/camel-vee-folder.c:vee_rebuild_folder() loads cached vFolder, if the
current vf is vTrash, it should remove those uids that are undeleted.
Comment 1 Yan Li 2009-09-02 07:14:27 UTC
Created attachment 142299 [details] [review]
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anja.patch

This is my fix to this bug, please help to review.
Comment 2 Yan Li 2009-09-02 07:42:08 UTC
Created attachment 142301 [details] [review]
Patch: vee_rebuild_folder() code cleanup and adding comments

BTW, vee_rebuild_folder() is very long and complex, the comments are sparse, it's very difficult to read. I'm attaching a little patch that tries to improve the readability a little. It doesn't change code behavior but removes a redundant variable and adds some comments. Please review.
Comment 3 Srinivasa Ragavan 2009-09-02 09:46:53 UTC
Comment on attachment 142301 [details] [review]
Patch: vee_rebuild_folder() code cleanup and adding comments

Commit to gnome-2-28 branch and master branch.
Comment 4 Srinivasa Ragavan 2009-09-02 09:48:12 UTC
Comment on attachment 142299 [details] [review]
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anja.patch

This patch breaks abstraction. CamelVeeFolder is the parent of CamelVTrash. YOu cant compare for trash inside of vfolder. It needs to be done better. Do you have any steps to reproduce this?
Comment 5 Yan Li 2009-09-03 02:33:11 UTC
You are right. Then I think we can move that function into a new procedure vtrash_cleanup_undeleted_mail() to do this.
Comment 6 Yan Li 2009-09-03 10:11:30 UTC
Created attachment 142391 [details] [review]
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anjal-v2.patch

I've wrote a new API function camel_vtrash_folder_clean() that does the clean up on-demand. I'm not sure if adding a new API for this is OK, please review this v2 patch.

It worked in my test and partially fixed this bug. The Trash folder no longer shows ghost mails. The problem remain is that those uids are still in '.#evolution/Trash' table. They should be removed too.
Comment 7 Yan Li 2009-09-21 09:25:21 UTC
Created attachment 143574 [details] [review]
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anjal-v3.patch

This v3 patch is another slightly improved version over v2. No need to add a new func to API and no change to client programs is needed now. Everything is done automatically when you are getting a vtrash folder.

I'm committing this into Moblin so it can get more testing. Please review. Thanks.
Comment 8 Srinivasa Ragavan 2009-09-22 04:33:16 UTC
Comment on attachment 143574 [details] [review]
BUGFIX-GNOME-Bug-593882-Ghost-mails-seen-in-Anjal-v3.patch

Yan, my point remains the same. 

camel_vtrash_folder_clean() can't be called from camel-store.c This is a derived class function. It may not work for other folders. For example, Exchage doesn't even have vtrash. It will crash for them.
Comment 9 Srinivasa Ragavan 2009-09-22 04:34:04 UTC
Yan, do you have some steps which will reproduce this for me? I want to see how this happens, then it should be easy to fix it for me. I really dont understand the fix :(
Comment 10 Yan Li 2009-09-22 05:20:46 UTC
(In reply to comment #8)
> camel_vtrash_folder_clean() can't be called from camel-store.c This is a
> derived class function. It may not work for other folders. For example, Exchage
> doesn't even have vtrash. It will crash for them.

Can't I call it from camel_store_get_trash() when I know for sure the result is a (CamelVTrashFolder *)?

I've sent you a DB that has this issue.
Comment 11 David Woodhouse 2010-06-16 11:25:32 UTC
Ping. If this is still needed, it would be good to get it in before the 2.30.2 release...
Comment 12 David Woodhouse 2010-06-16 12:02:25 UTC
Yan Li, in the place you're calling it you don't even know that result is non-NULL. If there is _no_ vtrash folder, won't it just crash?

But even with that fixed and if you _did_ know that it will always be a CamelVTrashFolder rather than a store-specific CamelFolder subclass, it looks like the wrong approach. Shouldn't you be removing these messages from the vtrash folder at the time they're undeleted? Isn't that how they get _added_ to the folder in the first place -- not by trawling folders, looking for messages with the DELETED flag?
Comment 13 Srinivasa Ragavan 2010-06-17 07:34:46 UTC
http://bugs.meego.com/show_bug.cgi?id=1846 was caused by this patch and I had to handle it manually. This has to be done via adding base-class function in CamelFolder .
Comment 14 Michael Meeks 2010-06-29 10:33:32 UTC
So ... it would be lovely to get this patch into gnome-2-30 & up-stream properly, I was sorry to still see it included as a patch in the 1st round of updates :-) ...
Comment 15 Milan Crha 2015-06-22 06:29:22 UTC
I'm closing this as obsolete, I do not recall seeing miscounts in a Trash folder since at least 3.12.x.