This reduces lags by searching for incomplete emails in slices as
well as in separate database transactions.
This is a refinement of commit 6672f8, where the database was
searched in slices but in one transaction. This didn't completely
solve the db lags in this code path.
With the database improvements over this cycle, testing shows
that we can now switch to NORMAL synchronous mode with little to
no performance loss but better database safety.
This fixes a subtle bug in the IMAP stack. The most prominent symptom
was for the entire folder list to clear after running Geary for a day
or so. Smaller symptoms were less noticeable, but could include dropped
incoming messages (which would be picked up later when Geary was restarted
or the connection was dropped and reestablished).
The essential problem is that ClientConnection generates internal
IDLE commands to control data flow and to receive unsolicited
server data. It would always signal the corresponding IDLE responses
from the server. These were being stored in the ClientSession object
as "finished commands" for commands it did not issue, leading to the
internal IDLE tag being kept around in a hash map. When the tag
numbering rolled over (which could take 8 - 12 hours depending on the
connection) the ClientSession would complete new commands with those
leftover tags instantly, causing for results to be dropped and the
session state machine to be out of sync with the server.
The solution is simply not to report status responses for internal
IDLE commands.
The editor in the composer no longer shows its own scrollbar. Instead,
the conversation view allocates enough space to hold the composer
without any scrolling. The composer then positions and scrolls itself
to create the illusion that the outer scroll bar controls it.
To track the size of the composer, we put all the text in a div and mark
that as contenteditable. Then, when the div changes height, we update
the layout. We use the user_changed_contents signal as a proxy for
this.
https://bugzilla.gnome.org/show_bug.cgi?id=730955
When a TLS certificate warning is detected, the user will now be
presented with a warning dialog presenting them with three options:
Trust This Server, Always Trust This Server, and Don't Trust This
Server (the default). The user must select one of the first two
buttons for Geary to continue connecting to the server, otherwise it
will close the Account object for the duration of the application
session.
This patch introduces a dependency on gcr-3, which is used to pin TLS
certificates (i.e. persist the user's choice of ignoring the TLS
warnings).
Since different email accounts can have the same username, use the
full email address for the keyring to prevent collisions. This patch
will also migrate both username-based keys and the very early one-pw
keys (from 0.1).
When building sparse MessageSets, instead of constructing single one
it's possible for multiple to be returned, indicating that the number
of values exceeds a defined limit. This may require multiple I/Os to
complete all commands, although they can be pipelined.
While looking at a user's network log I spotted a server error related
to how Geary drops from the IMAP connection's IDLE state. There was a
timing hole where a command could be issued while a flush followed by
an IDLE was issued. Without updating the FSM, the new command would
be queued without issuing a DONE to end IDLE.
Changing a specal folder type involves adding and removing the folder
entry in the folder sidebar. Prior logic would look in the Inboxes
branch if the entry was not selected in the "normal" account branch
but not verify the folder in Inboxes was the one being removed. This
triggered an unwarranted "nothing selected" signal that caused the
conversation list to go blank at startup when Geary was associating
special folder types with folders.
Note that you must have multiple accounts registered w/ Geary to
trigger this bug.
The autostart .desktop file shouldn't have a MIME type association,
otherwise it will make Geary appear twice in the drop-down list of
email applications.
Attachments without Content-Disposition are now generated and shown
in the client. This requires a database upgrade as well as rescanning
all messages to generate the previously missing attachments.
In addition, this upgrade now stores the attachments' Content-ID in
the database. This makes it much easier for the client to associate
a particular MIME section in the RFC822 message with an attachment in
the database and on disk.
This code fixes a couple of corner cases discovered by a user and
myself regarding connection drops and reestablishment.
1. When BYE received from the server, begin disconnecting immediately.
Otherwise it's possible for the server to send a BYE and drop the cx
ungracefully (or the FCLOSE is never received) and leave the
ClientSession active. By disconnecting immediately, Geary can cleanly
break the session and immediately reestablish another one.
2. Remove the DISCONNECTING state from ClientSession. There was an
asymmetry in the state machine with regards to how local disconnects
were handled (and exposed by #1). Analysis showed that the
DISCONNECTING state was unnecessary since there was no need to wait
for events to come back from the ClientConenction. Now the FSM
transitions straight to BROKEN when disconnecting.
3. Flushing pending commands in the replay queue was being determined
by the remote close reason. This is insufficient in the case of BYE
because it's a non-error close but, because it's initiated by the
server, pending commands should not be flushed. An additional close
flag deals with this case.
While going through a database upgrade, I noticed (once again) debug
messages reporting bad Message-IDs in messages. On closer inspection,
now see that our parser was tripping on Message-IDs with spaces inside
the brackets. Need to allow this, so this new algorithm deals with
that.
Discovered a few binding problems while working on another issue,
in particular gmime_parser_construct_message()'s return object
not being freed, which can hold an entire message (attachments and
all) in memory.
Autocomplete now uses a properly-quoted RFC822 string when an address
is selected from the drop-down list. This resolves the most egregious
case of the composer not accepting an email address formatted
[Last, First <mailbox@host>], as autocomplete is heavily relied-upon
and Geary is presenting an address that can't be used, which is
confusing.
It's still possible for the user to manually enter such an address w/o
quotes (either typing or pasting it in). However, this seems like a
far less problematic use case. The ticket remains open due to this,
however.
Finally, some comments have been added to clarify the difference
between RFC822.MailboxAddress.get_full_address() and
to_rfc822_string(). I've also done a code-review to check that both
methods are being used correctly elsewhere in the code.
Make two sets of the buttons, one for the start and one for the end of
the HeaderBar, and show one or the other based on the the theme. Watch
the style context for changes in the theme and update accordingly. Once
the composer is detached, the default close button is used, so hide both
and stop watching for style updates. This assumes we never re-attach a
composer.
We also add a bit of space between the separator and the detach button.
https://bugzilla.gnome.org/show_bug.cgi?id=733372