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 776029 - Inbox never prefetched/sync'ed
Inbox never prefetched/sync'ed
Status: RESOLVED FIXED
Product: geary
Classification: Other
Component: engine
master
Other Linux
: Normal major
: 0.11.3
Assigned To: Geary Maintainers
Geary Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-13 01:50 UTC by Michael Gratton
Modified: 2017-01-16 09:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix Inbox never being prefetched, since it is never sync'ed (2.96 KB, patch)
2016-12-13 02:08 UTC, Michael Gratton
none Details | Review

Description Michael Gratton 2016-12-13 01:50:21 UTC
From the mailing list: https://mail.gnome.org/archives/geary-list/2016-December/msg00012.html

> Hi,
> 
> from my testing, the prefetch_period_days does not work for INBOX.
> This is annoying, I want to prefetch all my e-mail, so I can run searches.
> 
> As far as I could, I've traced the problem down to this condition in
> send_all:
> 
>     if (imap_folder.get_open_state() != Folder.OpenState.CLOSED)
>                 continue;
> 
> https://github.com/GNOME/geary/blob/master/src/engine/imap-engine/imap-engine-account-synchronizer.vala#L151
> 
> INBOX is always open and thus is never sent to process_queue_async.
> 
> I've tried removing that condition and it _seems_ to work OK.
> From the comment in that block, it's not clear whether that condition
> is just a performance optimization or it there's a possible consistency
> issue lurking.
> 
> Ricardo
Comment 1 Michael Gratton 2016-12-13 02:08:25 UTC
Created attachment 341857 [details] [review]
Fix Inbox never being prefetched, since it is never sync'ed
Comment 2 Gautier Pelloux-Prayer 2016-12-13 12:32:11 UTC
I've tried it and indeed it works much better with the patch. Previously I was stuck at 50 from 9500 emails being fetched. 
With the patch, all INBOX emails have been downloaded! Hourray!
Comment 3 Michael Gratton 2016-12-14 00:56:06 UTC
Okay, cool. I've pushed this to master as commit 58efb70, will let it get some further testing there for a while and then cherry pick onto geary-0.11.
Comment 4 Michael Gratton 2016-12-18 15:38:37 UTC
Fix cherry-picked to geary-0.11 and pushed as commit 1bc3251.
Comment 5 Jose 2017-01-04 11:53:43 UTC
Hello, does this fix apply to any other folder apart from Inbox? I have some folders in an IMAP account and only the first ones are retrieved. If there are enough to scroll then the rest are retrieved when scrolling but if there's not enough messages prefetched I have to reduce the size of the window to force scrolling and then scroll until all are fetched. Doesn't this patch address this?
Comment 6 Michael Gratton 2017-01-14 00:21:44 UTC
(In reply to Jose from comment #5)
> Hello, does this fix apply to any other folder apart from Inbox?

Technically yes, but not really in practice. Can you please open another bug so we can look into this?
Comment 7 Jose 2017-01-16 09:06:59 UTC
I already opened it a couple of months ago:

https://bugzilla.gnome.org/show_bug.cgi?id=773508