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 556001 - search does not function correctly in evolution 2.25.1 (svn trunk build)
search does not function correctly in evolution 2.25.1 (svn trunk build)
Status: RESOLVED OBSOLETE
Product: evolution
Classification: Applications
Component: Mailer
2.26.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2008-10-12 10:51 UTC by Thomas
Modified: 2013-09-12 11:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
gdb stacktrace (3.70 KB, text/plain)
2008-10-28 18:53 UTC, Thomas
  Details
patch for all account search problems (2.16 KB, patch)
2008-10-29 00:04 UTC, Thomas
none Details | Review
corrected patch (2.41 KB, patch)
2008-10-29 22:50 UTC, Thomas
reviewed Details | Review

Description Thomas 2008-10-12 10:51:31 UTC
Please describe the problem:
I have an imap account and local folders. I search for a term in the mail body. 
2 messages contain this term. One is located in my imap folders, the other in my local folders.
When I select the Inbox folder of the imap account and choose "All Accounts" for the search, only the one in the local folders is found. When I choose "Current Account", the one in the imap folders is found correctly.

This is just an example of some oddities with the search, which makes it somewhat unreliable.

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
I do have the trunk checkout here. It's a recent build. If you give me some instructions on how to debug this, I can give more details.

Regards, thomas
Comment 1 Srinivasa Ragavan 2008-10-13 03:49:57 UTC
Akhil, can you verify this?
Comment 2 Srinivasa Ragavan 2008-10-14 18:40:04 UTC
Don't feel that this is disk summary specific. Jony can you look at this search thing? 
Comment 3 Thomas 2008-10-24 23:53:54 UTC
I debugged this beast a little and think I found the problem spot to be in evolution/mail/mail-vfolder.c, in function mail_vfolder_add_uri.
In line 447 it sets an ignore flag, so draft/Outbox/Sent folders dont't make into source_folders_local. This variable is later returned in function emfb_search_search_activated in evolution/mail/em-folder-browser.c, line 123

/* FIXME: there got to be a better way :) */
/* Add the local folders */
  l = mail_vfolder_get_sources_local ();

Note the FIXME above. So that's why I could not find that mail in the Sent folder.

Regards,
thomas
Comment 4 Johnny Jacob 2008-10-28 17:29:15 UTC
(In reply to comment #3)
> I debugged this beast a little and think I found the problem spot to be in
> evolution/mail/mail-vfolder.c, in function mail_vfolder_add_uri.
> In line 447 it sets an ignore flag, so draft/Outbox/Sent folders dont't make
> into source_folders_local. This variable is later returned in function
> emfb_search_search_activated in evolution/mail/em-folder-browser.c, line 123
> 
> /* FIXME: there got to be a better way :) */

;-)

> /* Add the local folders */
>   l = mail_vfolder_get_sources_local ();
> 

Will you be able to get a patch for this ? :)
Comment 5 Thomas 2008-10-28 18:48:41 UTC
Well, I added code to include the Sent and drafts folders. Now that mail in the sent folder is found with all-accounts-search, while the 2 mails in that imap folder are not found anymore.
Astonishingly, if I just delete the final character of the search term, all 3 mails are found. Must be something with these caching folders. But that's beyond me right now. 
Comment 6 Thomas 2008-10-28 18:53:09 UTC
... and got a nice crash. Can't remember specifically what I was doing but I have the core file. Attached is the stacktrace from gdb.
Comment 7 Thomas 2008-10-28 18:53:56 UTC
Created attachment 121528 [details]
gdb stacktrace
Comment 8 Thomas 2008-10-29 00:04:26 UTC
Created attachment 121554 [details] [review]
patch for all account search problems
Comment 9 Thomas 2008-10-29 00:05:14 UTC
The reason why the mails in the imap account were not found was, that there was no output stream to the imap store.
Attached comes the patch.
Comment 10 Thomas 2008-10-29 22:50:28 UTC
Created attachment 121611 [details] [review]
corrected patch

Inserting camel_imap_store_connected into imap_command_start led to endless loops. So I put it into imap_body_contains.
Comment 11 Srinivasa Ragavan 2008-11-02 17:11:41 UTC
I didnt understand your em-folder-browser.c changes. Are they intentional ?
Comment 12 Thomas 2008-11-02 18:54:04 UTC
(In reply to comment #11)
> I didnt understand your em-folder-browser.c changes. Are they intentional ?
> 

Sure. See comment #3.

thomas
Comment 13 Srinivasa Ragavan 2008-11-07 08:22:00 UTC
I got it Thomas. Why is the imap_* change needed for this? Do you have a issue/trace for that endless loop?
Comment 14 Thomas 2008-11-07 15:46:13 UTC
When I debugged the search, I found that there always came these "No output stream" message in the debug output, which is in imap_command_start. So I tried to put a call to camel_imap_store_connected in there. Unfortunately, camel_imap_store_connected again calls imap_command_start, therefore the endless loop. So I put it into imap_body_contains in file camel_imap_search.c.

thomas

Comment 15 Srinivasa Ragavan 2008-11-10 05:20:35 UTC
Thomas, do you have a stack trace for this? Because, it checks for offline before your fix.
Comment 16 Srinivasa Ragavan 2008-12-10 08:40:00 UTC
Thomas: Ping.. Do you have a stack trace for the infinite loop you said. I think I must see to understand it better. Thanks.
Comment 17 Thomas 2008-12-10 22:12:31 UTC
The first patch, I submitted was the one that caused the endless-loop. 
http://bugzilla.gnome.org/attachment.cgi?id=121554&action=view

Can you reproduce it?
Comment 18 Srinivasa Ragavan 2008-12-11 10:57:48 UTC
Oh wait, so your patch caused it and you reworked to fix it. Good. I never understood that. Lemme try and see it. thanks Thomas.
Comment 19 Akhil Laddha 2009-07-17 03:57:58 UTC
ping, any update on the patch ?
Comment 20 Thomas 2009-07-18 19:09:32 UTC
No, nothing new. I use stacked git (stg) to apply this patch over the latest git version pulled.
Comment 21 André Klapper 2012-02-08 10:57:58 UTC
So does this patch still needs rework? Or needs to be committed?
Srag / Thomas?
Comment 22 Thomas 2012-02-08 13:25:20 UTC
(In reply to comment #21)
> So does this patch still needs rework? Or needs to be committed?
> Srag / Thomas?

I checked my local sources (still 2.28.4) and found part of the patch applied,
i.e. the part in camel-imap-search.c, but the first change in em-folder-browser is not present in my sources.
Definitely needs some rework. Don't commit that!!
Hope that helps, 
thomas
Comment 23 Milan Crha 2013-09-12 11:06:15 UTC
This is fixed in 3.8.4, thus I'm closing it.