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.
ClientConnection state machine had a timing hole where two DONEs could
be issued in near-succession when closing a single IDLE command.
The hole is issuing the DONE *before* the server acknowledged it
was idling. When the idling continuation response was received,
the state machine would go to IDLE. Then, when the next command
was submitted, a second DONE would be issued. The second DONE
would be treated by the server as a tag with no command, causing
a CLIENTBUG response.
This tracks outstanding DONE commands when deidling and prevents
switching to the IDLE state when an idline continuation response
is received while waiting for the DONE to complete.
This patch drastically improves network connection handling and
reestablishment. In particular, the ImapEngine.Folder's open_count
wasn't always properly maintained (in the engine and the client)
causing connection reestablishment issues. Also, prior code attempted
to deduce when to reestablish a connection based on the type of Error
encountered. Now, as long as the Folder's open_count is greater than
zero, reestablishment will be attempted (with a back-off algorithm and
special cases in the ClientSessionManager preventing continual login,
i.e. when credentials are bad).
ClientSessionManager also has a back-off algorithm when it's adjusting
its session pool and uses the NetworkMonitor to detect when the host
is simply unavailable due to the network being unavailable (to prevent
continuous retries).
In addition to the above bug, this patch solves the following tickets:
Bug #714595
Bug #725959
Bug #712960
Clearing the ConversationListStore caused multiple selection-changed
notifications to the ConversationListView, whose signals in turn
caused I/O in the GearyController. This stops that process in its
tracks.
The composer can hide itself while the draft manager is in the process
of closing up. If we try to close that composer again, it should
automatically return PENDING_CLOSE instead of asking the user what to
do.
We do this heuristically, by noting which messages it is in reply to and
seeing if it matches the unmodified reply or reply all states. This
isn't perfect; notably forwarded messages are picked up.
We hide the existing draft in the conversation viewer as soon as we open
the composer. We also ensure that future versions of this draft will
also be hidden. The list of emails to be hidden is cleared when the
conversation viewer is, so we query all open composers at this point to
see which email ids should be hidden.
https://bugzilla.gnome.org/show_bug.cgi?id=743067
When the user replies with a quote to a second message, the composer
moves into a paned below the conversation viewer. This makes it easy to
scroll through the conversation and select text for replies.
The Gtk.Paned acutally holds a Box, which in turn can hold many
ComposerBoxes. Only one is shown at a time, but the model used
elsewhere is that each ComposerWidget has a ComposerContainer until it
is destroyed. When a composer is closed, it hides while finishing up
asynchronous work. This allows us to hold hidden paned composers as
they finish up their work.
The logic for focus handling at detachment is moved into the
ComposerWidget from ComposerEmbed, since it may also be detached from
the paned state. ComposerContainers gain a remove_composer() method
that does the container's clean up, as well as returning the focused
widget. The ComposerWindow's remove_composer() method should never be
called.
https://bugzilla.gnome.org/show_bug.cgi?id=738188
When replying to a message, we use the existing inline composer if it
already references the message we're replying to, or if we're replying
with a quote. Replies without quotes get made into new composers.
When adding a new message as a reply in a composer, we add the relevant
addresses to the to and cc lines, based on the current reply type. We
remove duplicates, and don't include any to addresses as cc. We also
keep track of a total to and total cc list, which gets swapped in if a
reply action is to change the reply type.
We keep track of all the replied-to message ids and include all of them
in the In-Reply-To header. However, the References header only includes
message ids from the first message replied to. This is because RFC 2822
requires this header to represent a single lineage, which we cannot
guarantee if we're replying to different branches of the conversation.
With the Empty button now attached to Archive/Trash/Delete, it's now
less lopsided for only Archive to have a label. This removes the
label from Trash/Delete (which also makes it more innocuous when the
user presses Shift a lot, i.e. while editing in the inline composer),
which in turns simplifies building the main toolbar.
At two seconds, the background AccountSynchronizer kicks in too
quickly and can interfere with foreground operations, especially when
the Inbox is being normalized at startup.
do_save_attachments() is called by schema update 22, which is prior
to when DeleteAttachmentFileTable was introduced (in update 24).
Ignore error if cannot remove from that table, i.e. it doesn't exist
yet.
Trash and Spam folders may now be emptied by Geary. A user warning is
presented, as the operation cannot be undone and deletes mail on the
server, not just locally.
Issue introduced with recent move to DraftManager. When Geary is
closed with an open composer, the window would hide but the app
itself would hang. This was due to telling the GearyController that
a close was pending when it was not. Now, when PENDING is returned,
the draft is saved or discarded (based on user input) and the
DraftManager fully closed, ensuring the I/O operation is flushed and
completed.
Introduces a DraftManager class which handles saving and deleting
drafts for the composer and error situations. Not perfect yet w/o
better support in the Engine for dealing with network disconnects
and offline mode, but much better than before for ensuring that drafts
are not orphaned in the Drafts folder.
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.
Geary now offers "true" deletion of messages in Gmail. It does this
by moving the offending email to the Trash folder and then expunging
them from the Trash.
Fortunately, this works with the composer without changes, meaning
discarded drafts won't sit in the Trash for 30 days.
Email address such as ["<S dude@example. com>" <s.dude@example.com>]
was not being escaped for HTML, so the S tag would strike-out the
remaining text in the address line. This patch corrects that.
While working on this, I noticed as well that the mailto: link was not
being properly formed due to lack of quoting. By using
MailboxAddress.to_rfc822_string(), problem solved.
A follow-up to recent garbage collection commit. Prior trigger for
VACUUM required a large number of reaped messages, indicating disk
fragmentation but not necessarily an indication of free space that
could be returned to the operating system. This patch adds trigger
looking for 500MB of free space in database, large enough to justify
a full rebuild.
See the ticket (comment #2) for more information on the thinking and
strategy here, but in a nutshell this will remove from the Geary
database all emails no longer accessible via any folder and not seen
on the server in over 30 days. It also deletes those messages
attachment(s) and removes any empty directories in the attachment/
directory to prevent clutter. If enough messages are garbage
collected, Geary will vacuum the database at startup, which will
lower its disk footprint and reduce fragmentation, potentially
increasing performance.
This introduces a new full-text search algorithm that attempts to
curb the effects of overstemming in the Porter Snowball stemmer.
The FTS table will be regenerated with this update.
The crux of this new algorithm is a configurable heuristic that
reduces stemmed matching. The configuration is not available via the
UI (I suspect it will only confuse users) but can be changed by power
users via GSettings. More information is available at:
https://wiki.gnome.org/Apps/Geary/FullTextSearchStrategy
Although prior fix for bug #737811 solved problem for some users,
apparently Geary still had an issue when upgrading a database with
new GLib Mutex implementation, which uses Linux's futexes whenever
available. This solution gives the notifying thread a chance to
signal the waiter that its work is completed.
Prior code inadvertantly limited UID and UIDVALIDITY to signed, not
unsigned, 32-bit integers. I've also added stronger checking of
numbers received off the wire, both that they're truly numeric
according to RFC and that they're within boundaries, if specified.
This also enforces bit width of integers from IMAP string parameters
to avoid similar problems in the future.
Bug #740041.
* src/engine/imap/message/imap-internal-date.vala:
Geary.Imap.InternalDate::to_search_parameter was returning the result
of serialize(), rather than serialize_for_search().
Commit 96aaf3 fixed a bug with regard to IDLE status responses being
improperly reported to ClientSession. As it turned out, that fix
introduced a bug by not properly decrementing outstanding_cmds, which
left the ClientConnection in a state where it would never enter IDLE
thereafter.
The problem is a change I pondered at the time but didn't commit due
to that fix being so close to release time: not reporting the original
IDLE command to ClientSession either. That in itself is harmless, but
not doing that also avoids incrementing outstanding_cmds for that
command, meaning when the IDLE completes that value returns to zero
and the ClientConnection is in an appropriate state to return to IDLE
when ready.
We've become more confident about saving drafts (although issues
remain ensure old ones are deleted as new ones take their place).
I'm dropping the timeout to 10 seconds to reduce network activity
and the number of discarded drafts generated while writing them, which
fills up the users' trash.
The text label needed to have an ellipsize mode set, otherwise it
enforced a minimum width of the label text itself. Worse, even if
that label was removed, the minimum width remained.
This fix might be too generous, as it allows for the sidebar to be
collapsed pretty narrowly, causing all text to be ellipsized. It's a
start, however.
The assertion was a sanity check that's outlived its original purpose.
When it triggers now, it means an internationalization/encoding issue,
usually with non-Gmail servers that implement XLIST. Rather than
assert and make Geary unusuable for a subset of our non-English
speaking users, log a message and continue.
This also closes bug #713808, as lesser-used fields (Reply-To, Bcc)
are hidden unless the user expands the composer to show them. Right
now that is an option in the composer's toolbar menu; that may change
in the future if we can find the right place to put the widgetry.
This is the result of the recent fix for Turkish locale users. That
patch was sufficient to solve their issue, but this patch is more
thorough in naming to ensure in the future it's understood that the
IMAP StringParameter objects deal in ASCII, not UTF-8. If a string
cannot be converted into a StringParameter (must be represented by a
LiteralParameter), that is now also enforced via an ImapError.
Discovered while working on Turkish UTF-8 bug, technically the IMAP
Deserializer was missing two things: (a) NUL is never allowed in an
IMAP line, even if the string is quoted, and so it should be dropped
rather than processed and cause potential issues, and (b)
DataInputStream will read to EOL, potentially leaving embedded NULs in
the line, meaning the old code would stop without processing the
entire IMAP response.
Although no server has been reported with these issues, I felt it
important to get this right as a defensive measure.