Commit graph

6346 commits

Author SHA1 Message Date
Michael Gratton
41be8693d4 Geary.Imap.ClientSession: Treat logout as disconnect
Convert `get_protocol_state` to an automatic property, so that rather
than requiring explcit signals for lifecycle events, a GObject notify
signal can be used instead.

Convert disconnect signal to a property so it can be accessed if needed.

Convert code listening to the disconnect signal to listen to notify
signals for `protocol_state` instead, and hence also treat the session
as disconnected when a logout is in progress.

Fixes #986
2020-09-27 17:38:10 +10:00
Michael Gratton
ed4ba33127 Geary.State.Machine: Support GObject notify signal for state changes
Modernise the API a bit by using properties instead of explicit
getters/setters, an hence support GObject notify signals when the
state property changes.
2020-09-27 16:18:26 +10:00
Michael Gratton
ac425f57b1 Geary.Imap.SessionObject: Rename claim_session to get_session
Don't over-sell what it does.
2020-09-27 16:18:26 +10:00
Michael Gratton
b209f84e58 Geary.Imap.FolderSession: Ensure client session is selected when accessed
Ensure the underlying ClientSession object is in the SELECTED state
for the correct mailbox when obtaining it.
2020-09-27 16:18:26 +10:00
Michael Gratton
1c951f8908 Geary.Imap.SessionObject: Ensure the session is connected when accessed
Ensure the client session is connected as well as non-null when being
accessed, so that if being logged out it is also treated as being
disconnected.
2020-09-27 16:18:26 +10:00
Michael Gratton
2093aa3229 Geary.Imap.Session: Avoid critical when client session logged out
If the client session is being logging out but some other tasks is
still attempting to use it, getting a mailbox will assume at least
one personal namespace exists, but it will have been cleared.

Add a check and throw an exception if none are present, so at least
it is handled in a well defined way.

Fixes #986
2020-09-27 16:18:26 +10:00
Michael Gratton
13f5602446 Merge branch 'mjog/991-gcr-critical' into 'mainline'
Fix GCR critical

Closes #991

See merge request GNOME/geary!583
2020-09-24 22:59:08 +00:00
Michael Gratton
82f0ca8d0f Merge branch 'mjog/db-result-timing' into 'mainline'
Database contention and locking redux

See merge request GNOME/geary!578
2020-09-24 22:54:30 +00:00
Michael Gratton
0475d29f84 Application.CertificateManager: Warn when GCR not able to access stores
At least let people know somehow their GCR setup is lacking.
2020-09-25 08:27:36 +10:00
Michael Gratton
7f7c55e79a Application.CertificateManager: Fix critical when no GCR trust stores
Ensure GCR store not null before accessing it.
2020-09-25 08:25:34 +10:00
Michael Gratton
880705f2ab Update files for 40 development 2020-09-25 08:23:15 +10:00
Daniel Mustieles
571c10add8 Updated Spanish translation 2020-09-23 09:26:43 +02:00
Dušan Kazik
5942e30377 Update Slovak translation
(cherry picked from commit 2028c9dea3f1d8f6c5dcfdd44f5f1990121e0983)
2020-09-21 11:52:27 +00:00
Dušan Kazik
e56e2a8e54 Update Slovak translation 2020-09-16 11:28:54 +00:00
Goran Vidović
d26894046b Update Croatian translation 2020-09-15 23:26:19 +00:00
Goran Vidović
3e176af1e1 Update Croatian translation 2020-09-15 23:17:28 +00:00
Fabio Tomat
e957f0f8a7 Update Friulian translation 2020-09-15 06:56:54 +00:00
Fabio Tomat
acabdc9e73 Update Friulian translation 2020-09-15 05:52:24 +00:00
Fabio Tomat
4a4e6a6992 Update Friulian translation 2020-09-15 05:20:06 +00:00
Fabio Tomat
56b77cf0d7 Update Friulian translation 2020-09-14 19:32:40 +00:00
Michael Gratton
26f3878a7a Update files for 3.38.0.1 2020-09-14 23:36:32 +10:00
Michael Gratton
a67d55bff6 Merge branch 'mjog/forgotten-sql-files' into 'mainline'
sql: Remember to install new SQL migration files

See merge request GNOME/geary!581
2020-09-13 14:22:45 +00:00
Michael Gratton
1e2ae9410f sql: Remember to install new SQL migration files 2020-09-13 23:59:00 +10:00
Jordi Mas
b72a8491c6 Update Catalan translation 2020-09-13 09:34:47 +02:00
Michael Gratton
22b642edef Update files for 3.38 2020-09-13 14:21:30 +10:00
Michael Gratton
3d8b86dd4e Geary.ImapDB.Folder: Drop create/merge batch size down
We've had reports on Matrix that existing batch transactions in
`create_or_merge_email_async` are taking up to 30s to run, which is
getting uncomfortably close to the 60s timeout.

Drop the batch size down from 25 to 10 to reduce the chance that this
will eventually fail with a "database is locked" error.

See #921 for context.
2020-09-12 12:02:49 +10:00
Michael Gratton
915a38faca Geary.ImapDb.Account: Slice up search table population work better
Although populating the search table had been broken up into batches
of 50 email, it was still search for and loading every single message
id in both the MessageTable and MessageSearchTable, doing a manual
join, and then updating the batch, for *each* batch, and in a RW
transaction.

Break this up so that the ids are loaded and joined only once, the
queries happens in a RO transaction, the manual join happens in a side
thread, leaving each RW transaction only having to load the messages
and update the search index for up to 50 messages.
2020-09-11 00:00:02 +10:00
Michael Gratton
0f60c285df Geary.Db: Update SQL logging
Ensure all code paths that execute SQL are logging it if enabled, and
clean up the log formatting.

Add new `enable_result_logging` static property to control result
logging separately from SQL logging, so we can get SQL logged without
having to see email. Clean up result formatting, and keep track of the
current result row number and log that as context.
2020-09-10 23:59:05 +10:00
Michael Gratton
e39853db62 Geary.ImapEngine.GenericAccount: Set database logging parent per account
Set the database's logging parent so its log statements are associated
with its account in the inspector.
2020-09-10 19:07:42 +10:00
Michael Gratton
940ca83195 Geary.Db.Context: Remove separate logging_parent property
Since each context type already has access to the object that is its
context parent, don't bother with a stand-alone `logging_parent`
property, just have context types implement it and return the
appropriate object.
2020-09-10 19:07:42 +10:00
Michael Gratton
0fa0d0ea4d Geary.Db.Statement: Minor code cleanup
Make `sql` a proper auto property. Remove expanded sql workaround.
Minor code style cleanup.
2020-09-10 19:07:42 +10:00
Michael Gratton
485868d570 Geary.Db.DatabaseConnection: Check elapsed time for exec statements
Re-work elapsed timer to be usable in other context objects, use it
for timing exec query execution.
2020-09-10 19:07:28 +10:00
Jordi Mas
ea40569251 Update Catalan translation 2020-09-08 22:42:52 +02:00
Fabio Tomat
d3905e141d Update Friulian translation 2020-09-08 14:22:36 +00:00
Michael Gratton
a1d31847b1 Geary.Db.Result: Log large elapsed query times as a warning
Help ensure that long-running queries get some visibility during
development.
2020-09-08 22:13:39 +10:00
Michael Gratton
3b6dd30332 Geary.Db.Context: Update access to DatabaseConnections
Ensure internal code can access a DatabaseConnection from context
objects to get access to connection-specific code, but make the
polymorphic context accessors internal so transactions can't access
them.
2020-09-08 22:13:19 +10:00
Michael Gratton
5b64939490 Update files for 3.37.92 2020-09-06 08:48:36 +10:00
Michael Gratton
45c27dffa4 Merge branch '921-slow-old-detach-query' into 'mainline'
Fix query performance regression in old message detachment

See merge request GNOME/geary!577
2020-09-05 05:09:30 +00:00
Michael Gratton
4ae97ab74b Merge branch 'mjog/921-db-locked' into 'mainline'
Database is locked error

See merge request GNOME/geary!576
2020-09-05 04:51:32 +00:00
Michael Gratton
6d473a2655 Geary.Logging.Record: Stop keeping a ref on logging source objects
When constructing a new record, rather that getting the state object
from a source and hanging on to it, just keep a few salient details
and then release it, so we don't keep a ref to the source hanging
around. This also means we need to pre-fill well-known up front, adding
some overhead when not logging.

This fixes hitting resource limits like memory and file descriptors
when lots of objects are logged, as seen when logging is enabled for
the DB, and in particular for `DatabaseConnection` objects, since each
one represents an open SQLite database file and related state.

It also ruins the glorious future in which we could inspect logged
objects in the Inspector in the same way that Firefox allows you to
inspect objects in the JS console, but c'est la ve. The way forward
there is probably adding structured data to state objects, allowing
sources to provide a curated set of properties to log.
2020-09-05 13:25:41 +10:00
Michael Gratton
2983990eca Application.Client: Ensure DB log messages show up in the inspector
Stop suppressing the db's logging domain by default for the moment.
2020-09-05 13:25:41 +10:00
Michael Gratton
dcad419b03 Geary.Db.DatabaseConnection: Add SQL debug logging when txns fail
This isn't a good place to do it, but neither GLib's error model not the
engine's database model makes it possible to getting access to
transaction state otherwise at the moment.
2020-09-05 13:25:41 +10:00
Michael Gratton
51ad8458a9 Geary.Db: Update logging implementation
Fix infinite recursion logging from DatabaseConnection caused by
`to_string` and Context implementing `to_logging_state` that calls that.
Make individual objects implement `Logging.Source` instead and have
them return appropriate, custom logging state individually.
2020-09-05 13:25:41 +10:00
Michael Gratton
257f6fb901 Geary.Db.Connection: Split up into db and transaction-specific impls
Convert `Connection` into an interface, add two concrete implementations
that allow splitting up the database connection used generally, and the
connection passed to transactions. This allows limiting the API surface
that transactions have access to (so they can't e.g. create
sub-transactions) and perform transaction-specific work (e.g. better
logging when an error occurs).
2020-09-05 13:25:41 +10:00
Chris Heywood
cea89ff9ec Fix query performance regression brought in with !556
The join used to determine how many messages should be left in the
folder was inefficient. The following query has also been performance
tested and found to be more efficient as a join (instead of a subquery).
2020-09-05 10:02:53 +10:00
Thibault Martin
801fa710cc Update French translation 2020-09-04 12:27:23 +00:00
Daniel Mustieles
d593fb37fe Updated Spanish translation 2020-09-04 13:07:11 +02:00
Michael Gratton
63b73c9d0e Merge branch 'mjog/imap-command-cancellation' into 'mainline'
IMAP command cancellation cleanup

See merge request GNOME/geary!574
2020-09-03 00:42:44 +00:00
Emin Tufan Çetin
850961467e Update Turkish translation 2020-09-02 11:43:48 +00:00
Michael Gratton
a123983cb0 Geary.Imap: Remove COMPRESS command
Geary hasn't used compression for IMAP in a while now due to the
possibility of information leakage for secure connections, so remove
the command as well.
2020-09-02 14:54:42 +10:00