Add Geary.Folder::synchronise_remote method to allow clients to
explicitly check for new mail in a folder. Move code from
ImapEngine.AccountSynchronizer as the basic implementation, but also
ensure pending replay queue notifications are processed before the
process is complete.
find . -name '*.vala' -type f -exec sed -i 's/ *$//g' {} +
The following files was ignored:
test/client/composer/composer-web-view-test.vala
test/engine/util-html-test.vala
Fix#271
Updating the unread count after opening a folder and finding email that
has an unexpected unread status messes up the count obtained from the
server, which has already taken these messages into account.
Here, both the main normalisation process and the email flag updater are
prevented from adjusting the unread count for a folder when they
encounter email that are new and unread, or have an unread status
different from what was last seen by the engine.
See #213
Convert getters that look like properties into actual properties,
remove unused and redundant public and internal API, convert
implementation to use a tree that aucyally maintains references between
steps, rather than each creating a new list of path steps and
manipulating that.
This doesn't make any sense for local-only folders, and only gets used
for internal implementation details for IMAP folders, so remove the
public API and replace its use internally.
This replaces the use of Geary.Folder.find_boundaries_async in
ConversationMonitor with a simple sorted set of known in-folder message
ids. This is both easy and fast, reduces needless DB load when loading
conversations, and also allows allows removing what is otherwise
single-use implementation overhead in classes deriving from Folder.
* src/engine/app/app-conversation-monitor.vala (ConversationMonitor):
Replace get_lowest_email_id_async() with window_lowest property, update
call sites. Implement the property by using a sorted set of known
listed email ids from the base folder. Update the set as messages in
the base folder are listed. Rename notify_emails_removed to just
removed and remove ids from the set if any messages from the base
folder are removed.
* src/engine/api/geary-folder.vala (Folder): Remove
get_lowest_email_id_async since it is now unused, do same for all
subclasses.
This commit makes the Imap.Account and Imap.Folder classes work somewhat
more like Imap.ClientSession, in that they have become higher-level
wrappers around ClientSession which come and go as the client session
does (i.e. as the connection to the IMAP server comes and goes). Further,
partly decouple account session lifecycle in ImapEngine.GenericAccount
and the folder session in ImapEngine.MinimalFolder from those objects
being opened/closed, so that sessions are created only when open /and/
the IMAP server is available, and disconnected on close /or/ when the
underlying connection goes away.
As a result, GenericAccount and MinimalFolder no longer claims a client
session on open and try to keep it forever. Instead if needed, they wait
for the server to become contactable.
This makes Geary much more robust in the face of changing network
connections - when working offline, resuming after sleep, and so on.
* src/engine/api/geary-folder.vala (OpenFlags): Remove FAST_OPEN, since
it is unimplemented and redundant with NO_DELAY. Update uses to simply
use its equivalent, NONE.
* src/client/application/geary-controller.vala (do_empty_folder_async),
src/engine/imap-db/outbox/smtp-outbox-folder.vala (save_sent_mail_async),
src/engine/imap-db/search/imap-db-search-folder.vala
(remove_email_async): Ensure folders opened are always correctly closed
after being opened.
This lets valadoc build Geary's engine docs again as long as patches for
valadoc Bug 736483 and Bug 646982 are applied (which will hopefully be
merged for vala 0.40). Once Bug 792349 is also fixed, we'll be able to
generate private docs as well.
For now, the undo stack is 1-deep with no redo facility, which mimics
Gmail's facility. We can consider later offering a more involved
undo stack, but would like to try this out for now and work out the
kinks before becoming more aggressive.
If a command fails due to a hard error (connection dropped, network
loss, etc.), the command is preserved in the in-memory Folder queue
and retried when the connection is reestablished. This makes Geary
more robust and resistant to simple errors due to connection loss,
i.e. archiving a message and having it return later because the
archive command was dropped and, when the connection reestablished,
the message "reappears" because it's still on the server.
Note that this is *not* offline mode or a replacement for it, merely
a way to make Geary more robust when a user's connection is flaky.
Since the dawn of time, Folder and Account were interfaces. It's
become obvious over time nothing was gained by making them interfaces,
only a duplication of effort when changing their API to update the
interface and then the abstract base class all other classes derive
from.
This makes both abstract classes, cleaning up the code a bit and
reducing complexity.
Noticed this while working on Gtk.HeaderBar patch, that if the display
name changes it won't be reflected in the UI.
Conflicts:
src/client/components/main-window.vala
src/engine/abstract/geary-abstract-folder.vala
This adds a progress monitor to the folder open operation. The spinner
in the status bar is hooked up to it only for the currently selected
folder, so that background updates don't trigger the spinner.
Closes: bgo #713703
This patch is a grab-bag of fixes to get mail onto the screen faster
and report new mail waiting on the server more quickly.
In a nutshell:
* Adds a NO_DELAY flag to Folder.open_async which indicates that
background remote connections should initiate ASAP rather than
wait for a local request that requires remote information.
* Reduce creation of ImapDB.Folders (which, previously, were
generated as though "cheap"), which means caching server
information. ImapDB now relies on ImapEngine to refresh that
information on its own.
* The background search table update is delayed to allow startup
database tasks priority.
* Rather than delay selection of a folder 100ms to prevent the user
from holding down a key or clicking madly, the initial selection
goes right through, but subsequent ones are delayed. This may
also help resolve bug #713468.
* And the big one: ImapEngine.Account doesn't load local and remote
folders in parallel at startup, but rather local first, reports
them to the user, and then loads the remote and pairs the two.
This gets the UI up and going much more quickly.
Folder now offers an "email-inserted" and "email-locally-inserted"
signal to indicate when email has been added (or discovered) but
is not added to the top of the message vector. SearchFolder and
ConversationMonitor may be able to use this better in the future.
This optimizes the search query itself, and also how we get the results:
instead of turning around and selecting the full row for each resulting
id, we simply pull out the id and internal date and that becomes the new
SearchEmailIdentifier. This new class also lets us more properly order
EmailIdentifiers everywhere else.
This is squashed commit (sorry -- we'll get better about maintaining a
clean history in collaborative branches in the future!) of a massive
amount of work from Jim and myself.
* EmailIdentifiers for normal (i.e. not outbox, etc.) emails are the
same regardless of which folder they came from
* New EmailStore interface to manipulate messages that reside in any
folder, without having to care what folders are open
* Relevant places that manipulate emails (e.g. the toolbar) have been
updated to use the new EmailStore interface
* Conversation and ImplConversation have been smooshed together
* Many, many more items and bugfixes related to the above points
This simplifies the various Folder implementations, removes one (large)
replay queue operation, makes vector expansion _much_ simpler, and
generally makes the Geary API a bit cleaner.
Because the code affected included some of the proposed fixes for
operation. That plus the vector expansion changes may have some
affect on that ticket.
This accomplishes a few things:
* Adds some signals to the Account that aggregate various Folder
signals, so anyone can find out when mail has been appended to any
folder, for example.
* Refactors the ConversationMonitor further. The conversation grouping
logic has been split out into a ConversationSet, and
ConversationMonitor proper is now just the folder interaction.
* The new ConversationSet tracks duplicate emails better using
Message-IDs, so if you get an email in multiple folders we can figure
out whether we should actually add it as a new email or not.
* Using all of that, we now kick off a full-conversations update
whenever new mail comes in on any folder, so your conversations update
as you're looking at them when Geary sees new mail, regardless of
folder.
A recent commit made Geary.Folder's FolderProperties a property
(rather than available via a getter). This commit makes its
FolderPath and SpecialFolderType also properties.
Conflicts:
sql/version-010.sql
src/client/folder-list/folder-list-folder-entry.vala
src/engine/rfc822/rfc822-message.vala
Also, I had to manually fix some compile errors introduced due to
interfaces changing on master.
Folders can now be FAST_OPEN'd, which is used by the background
account synchronizer to quickly determine what changes have occurred
to a folder and get it up-to-date. I've used Geary for a few days
with these changes and have seen a dramatic difference in sluggishness.
There are still CPU spikes when background work is detected, but
not like before and not nearly as sustained.
"make valadoc" will now produce valadoc/ in the top-level directory.
Still a lot of work to do to clean this up, as some names need to be
fixed for better heirarchy and others should be made private to prevent
leakage. And, of course, more classes, namespaces, and methods need
to be properly documented.
This patch solves the following memory/resource leak problems:
(a) Gee.TreeSet doesn't drop references when destroyed. Fixed by
using a subclass that clears the set when destroyed (exactly same
as patch made to Gee, however that won't be in distribution for
awhile.)
(b) Imap.ClientSession was holding refs to CommandResponses after
they'd been completed. They're now dropped.
(c) Imap.ClientSessionManager now has an open/close_async() (called
by Imap.Account.open/close_async()) that drops all ClientSessions.
(d) All classes in Engine (and some in the client) use Geary.BaseObject,
which uses a static map to track outstanding held references to
it. The table is dumped when Geary exits. Must be enabled with a
./configure flag.
Two outstanding memory leaks persist (one for Imap.ResponseCodes and
another when messages are selected/deselected), so this doesn't close
the ticket, but testing and use has shown these changes to make a huge
improvement on memory usage and reducing crashes.
This introduces a background account synchronizer into Geary that
prefetches email folder-by-folder to a user-configurable epoch. The
current default is 15 days.
Additional work to make this user-visible is coming, in particular with
The primary purpose for this feature is to allow "full" conversations
(#4293), which needs more of the mailbox stored locally to do searching.
Lots has been changed here. See the bug report
<http://redmine.yorba.org/issues/6230> for some of the discussion about
it.
This also fixes#6274. I'll cut the list of revisions off after a
while, because this branch has been outstanding for a couple weeks.
Squashed commit of the following:
commit ae505d89e87e63e0d8949bfd901913706a9d3b73
Merge: 81ef002 e18bef9
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 31 15:16:17 2013 -0800
Merge branch 'master' into multiple-accounts
commit 81ef002f5ff486b9c28f5663a0ba1e7392b8489c
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 31 15:15:51 2013 -0800
Fix final round of code review
commit 6935b1e7892b9b356bf5006b89e0b2a4e6a8ad16
Merge: c9ed434 a9dc52b
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 31 14:45:46 2013 -0800
Merge branch 'master' into multiple-accounts
commit c9ed434fe936e6aed735baef222ae615364c2513
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 31 14:31:02 2013 -0800
Simplify folder comparator
commit 28ac020cfd9135c6eb4ed05574c82b92f99c4a40
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 31 14:06:55 2013 -0800
Bump up declaration to conform to guidelines
commit 0a8167bdaebd5fac1c3ca791de5f2cc233c13cb9
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 31 13:54:03 2013 -0800
Rename back to list_*folders
commit 31457f60298052bdddba8e426db27f93d7c72529
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 31 12:36:15 2013 -0800
Fix spacing, brevity issues
commit ecd30c203d80c21c1ca1234b8911b57efcb68294
Author: Charles Lindsay <chaz@yorba.org>
Date: Wed Jan 30 17:56:29 2013 -0800
Fix nits before review
commit 85b51d71e83115991cd9a54d491b4d45b71f2f9b
Merge: b29abce d538bf0
Author: Charles Lindsay <chaz@yorba.org>
Date: Wed Jan 30 17:46:19 2013 -0800
Merge branch 'master' into multiple-accounts
commit b29abceeaea84f226ab9bcd22266a511691d8005
Author: Charles Lindsay <chaz@yorba.org>
Date: Wed Jan 30 17:22:28 2013 -0800
Fix notifications
commit c26d975fb0859d807ddb7f7c10632605c3b6fb1c
Author: Charles Lindsay <chaz@yorba.org>
Date: Wed Jan 30 13:01:03 2013 -0800
Only show current acct. folders in copy/move menus
commit 9a5b57db1229a079f11f518c53f5762a3670b83f
Author: Charles Lindsay <chaz@yorba.org>
Date: Wed Jan 30 11:48:05 2013 -0800
Fix issue where wrong mail would show in folders
commit 3b05d18843584c2aff7472708eea30ce24068043
Author: Charles Lindsay <chaz@yorba.org>
Date: Wed Jan 30 11:18:38 2013 -0800
Fix ordering of folders in side bar
commit b228967b6a74c16698d593e53e65d66c69ffb974
Author: Charles Lindsay <chaz@yorba.org>
Date: Wed Jan 30 11:07:32 2013 -0800
Add icon to accounts in sidebar
commit dd05d2c987a46f0b6699d743c339297e06829e4f
Author: Charles Lindsay <chaz@yorba.org>
Date: Tue Jan 29 19:04:52 2013 -0800
Fix Labels icon
commit b5254fe8f6ef37df48d41167d0f52f3cd88d1966
Author: Charles Lindsay <chaz@yorba.org>
Date: Tue Jan 29 18:43:45 2013 -0800
Initial stab at new FolderList; fix compile errors
commit ff591810ee4312acce208dfa36d993069bc4c7d2
Merge: 2b9dbb9 ff5f9fa
Author: Charles Lindsay <chaz@yorba.org>
Date: Mon Jan 28 17:42:34 2013 -0800
Merge branch 'master' into multiple-accounts
commit 2b9dbb9b6963b1d52b2b90300bcea277b01d2094
Merge: 7583241 fcfb460
Author: Charles Lindsay <chaz@yorba.org>
Date: Mon Jan 28 17:21:49 2013 -0800
Merge branch 'master' into multiple-accounts
Conflicts:
src/client/geary-controller.vala
commit 75832412cc806c956848e32ef20052af36d4f64d
Author: Charles Lindsay <chaz@yorba.org>
Date: Mon Jan 28 16:37:15 2013 -0800
Fix IMAP sess. mgr. to recover from bad passwords
commit 8868b4be5c3f5c97246d35c6170531c6f543abe1
Author: Charles Lindsay <chaz@yorba.org>
Date: Mon Jan 28 12:06:21 2013 -0800
Typo
commit 3f909054502d31ca48e11f7948fd22118afe7514
Author: Charles Lindsay <chaz@yorba.org>
Date: Mon Jan 28 10:54:51 2013 -0800
Clean up interface a little
commit 3bfb526fe8801f8234127944be8594a960ccf7e7
Merge: 5e84e93 e971275
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 16:23:52 2013 -0800
Merge branch 'master' into multiple-accounts
Conflicts:
src/client/geary-application.vala
src/engine/api/geary-engine.vala
commit 5e84e9375a655567a3bc4eb7ebaacab2d218be40
Merge: 35cc46b 9167aeb
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 16:17:00 2013 -0800
Merge branch 'pluggable-auth' into multiple-accounts
Conflicts:
src/engine/api/geary-engine.vala
commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 16:11:20 2013 -0800
Fix for code guidelines
commit 35cc46bc99f44f1597c609bfeaa72dd503333a17
Merge: 9675f47 7612a7d
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 15:44:18 2013 -0800
Merge branch 'pluggable-auth' into multiple-accounts
Conflicts:
src/client/geary-application.vala
commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 15:26:48 2013 -0800
Fix code review issues
commit 46635544c98df7a8b6c76f028715814907274389
Merge: 30b611e 6de36ae
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 12:54:03 2013 -0800
Merge branch 'master' into pluggable-auth
commit 9675f473e77d0d581cf73a33012981e6a4f44943
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 12:53:18 2013 -0800
Try to make Folder know about its Account
commit 5d9af43e53199a616490cf6ff98bd3c613b4e5f2
Merge: 335480e 6de36ae
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 12:12:21 2013 -0800
Merge branch 'master' into multiple-accounts
commit 335480e2dd0261c8fb82f1c6296f5b8c76f3ac02
Author: Charles Lindsay <chaz@yorba.org>
Date: Fri Jan 25 12:11:18 2013 -0800
Work on multiple accounts; fix compilation errors
commit 808e65d55798e3f08b4c70992718cc11befbb45c
Author: Charles Lindsay <chaz@yorba.org>
Date: Thu Jan 24 19:28:12 2013 -0800
Fix application logic for multiple accounts
You get the idea.
This fix requires a modification to the Geary.Folder contract, as now
the list and fetch operations will not wait for a connection to load
messages not locally stored. (A ListFlag option may be needed later
to force this behavior.) This also requires GearyController to reseed
the ConversationMonitor after the Folder is opened, otherwise no
messages will be loaded on an initial load of a folder.
This work exposed some smaller bugs, which are fixed here as well.
Rather than detect/guess what features are and are not available
on a folder, Geary.Folder methods have been broken out into
interfaces. Different Folders implement different interfaces
depending on what it may or may not support.
This change is in anticipation of #5354 and #4652.
This major patch switches Geary to using XLIST whenever possible
to identify special folders. Because it's now possible for special
folders to be identified by MailboxAttributes and/or hard-coded
paths, needed to find a flexible system for the various flavors to
identify them as such.
Courtesy Timo Kluck.
Squashed commit of many patches that merged Eric's outbox patch
as well as additional changes to upgrade the database rather than
require it be wiped and some refactoring suggested by the Outbox
implementation. Also updated Outbox to be fully atomic via
Transactions.