EmailFlags seemed to be a natural fit for EmailProperties, but
it became apparent that EmailFlags change all the time (and must
be polled to notice changes) while other properties are immutable.
For efficiency, moved EmailFlags out of EmailProperties and made
them their own Email.Field. EmailProperties may expand later to
supply user-visible information; for now, only used internally by
the IMAP stack.
Previously it was possible for the EXPUNGED server data's positional
addressing to be converted to the wrong EmailIdentifier, leading to
the wrong email being deleted, while the one the user asked for
was reported as missing as part of the ReplayQueue's local operation.
Problem was due to accumulation of messages marked for removal on
local side not being (eventually) removed from MessageLocationTable.
Can happen if folder is closed before EXPUNGE server data arrives,
or if Geary is shut down or crashes before same. Folder
normalization will deal with situation where locally removed
message was not actually removed on server.
Nate's log from this morning pointed to the culprit, namely that if
the connection fails while first establishing it, not all the
proper signals are being fired which trigger an attempt to
reestablish the connection in ConversationMonitor.
There is no loop inside MidstreamConverter.convert to cause this
to happen, but it's easy to imagine this being called from inside
a loop in close() or flush(). Although we can't repro this, I
believe this patch may solve the problem.
YorbaApplication's 'exiting' signal now allows callbacks to cancel the
edit. GearyController now keeps a list of all open ComposerWindows, and
listens for YorbaApplication's 'exiting' signal. When the signal is
received, GearyController warns the user about each open ComposerWindow
with unsent text. If the user cancels the closing of any of these
ComposerWindows, GearyController cancels the edit.
This patch adds additional logging and debug statements regarding
connection drops and resets and attempts by Geary.Conversations
to reestablish a connection. There's also some small changes
to simplify the disconnect code.
Prior work on fixing #5114 included using UID ranges when a new
message came in to avoid a perceived one-off problem. This returns
to the old way of doing things (using positional addressing), which
means not having to access the database to determine what messages
to fetch.
This appears to solve the problem entirely. The Conversations
object was maintaining extra refs to Conversation objects which
had been previously removed (archived) and reporting them as gone
to the client. But, when new messages came in for that old
conversation, it mistakenly associated them and reported them as
added, which the client silently ignored (it couldn't find the
conversation in its own list).
This patch fixes two bugs causing #5271. First, the ReplayQueue
wouldn't close due to the is_closed flag being set before submitting
the internal operation that flushes the queue. Second, the
retooled fetch_email_async() wasn't checking if the folder was
opened, causing problems with the flag watcher and prefetcher.
Additionally, debug logging was improved here, which helped debug
this problem.
Prior commit failed to solve this problem. Further study leads me
to believe that the two separate replay queues (send, recv) allow
for subtle timing holes. There is now a single replay queue that
manages both types of operations, meaning each one is executing
atomically without an operation on another queue changing state
out from underneath it.
This patch changes geary-mailer to make it more usable from the
command-line (for scripting and such). Not perfect (yet), but a
start. Important additions for later is being able to specify
subject and message body.
Eric once reported a triggered assertion inside Geary.StateMachine
that was unreproducible. This change means that if it happens
again better information will be logged to try and debug and/or
reproduce it.
Previously, Geary could sometimes request elements of an email
message it already had in the database. Often this was due to
the client requesting information already present as well as one
additional field; the old implementation required all the requested
fields be pulled down.
Now Geary will work out on a message-by-message basis what is
present and what is not and request only missing fields for each
one. It will cluster messages missing the same fields into the
same request and it submits all requests simultaneously, to take
advantage of IMAP pipelining.
This work has some orthogonal benefits toward #5224, better
Dovecot support, by making the upper layers able to merge an email
using both locally-fetched data and remotely-fetched data.
Gmail supports the CHILDREN extension, which means that labels
with children are marked as such. This information can be used
to prevent unnecessary recursion when loading the folder list
(which speeds startup).
In my Yahoo! account was an email with no Date: field in the
header (spam). This triggered a lot of assertions in Geary, both
the engine and the client. This fixes them.