Commit graph

1759 commits

Author SHA1 Message Date
Chris Heywood
0e96fa95fb Store last cleanup time in GarbageCollectionTable 2020-01-21 17:57:33 +01:00
Chris Heywood
43ecc35298 Minor fix to last commit 2020-01-10 18:08:37 +01:00
Chris Heywood
ae19398944 Improve cancel-ability of account storage cleanup 2020-01-10 17:41:06 +01:00
Chris Heywood
0f6db1ee28 Updated approach to background storage cleanup
Storage cleanup work now continues and also waits for each account to
complete before moving on
2020-01-10 14:18:01 +01:00
Chris Heywood
f5279c6533 GC vacuum: verify non-null services
Check IMAP and SMTP aren't null before stopping and starting, although
this should never occur anymore as we don't vacuum at startup.
2020-01-10 10:59:40 +01:00
Chris Heywood
f4a797253f Cleanup to last commit 2020-01-10 09:06:44 +01:00
Chris Heywood
8871f02532 Tweaked old message detachment batching 2020-01-10 09:04:25 +01:00
Chris Heywood
8cb8343366 Revert unwanted folder property update 2020-01-10 08:22:23 +01:00
Chris Heywood
187d613391 Try AccountOperation approach for GC post detach 2020-01-09 20:25:55 +01:00
Chris Heywood
4f89a593a5 Remove temporary WIP code 2020-01-09 20:23:49 +01:00
Chris Heywood
b70a9b4e6e Delete old messages in batches
Done to avoid hitting SQLITE_MAX_SQL_LENGTH with the IN clause, although
fairly unlikely
2020-01-09 18:23:40 +01:00
Chris Heywood
f60c42a36b More explicit class identification 2020-01-09 14:08:46 +01:00
Chris Heywood
8ccc0f3d60 Code cleanup for old message detach
Although this logic will likely be later removed
2020-01-09 13:41:02 +01:00
Chris Heywood
8d9c9ea943 Also stop SMTP when GC vacuuming 2020-01-09 13:38:33 +01:00
Chris Heywood
7dfe2971c6 Rename and improve doc. on method 2020-01-09 13:07:17 +01:00
Chris Heywood
d019d7ae9f Move, rename and document property 2020-01-09 13:00:52 +01:00
Chris Heywood
5d53bbec26 Merge branch 'mainline' into remove-old-msgs-beyond-storage-pref 2020-01-08 14:43:52 +01:00
Chris Heywood
2b20f1cc4d WIP towards responding to window focus in cleanup
The idea being that if we've returned into the foreground while old
message detachment was running the remaining background cleanup tasks
shouldn't be run.
2020-01-08 14:22:51 +01:00
Chris Heywood
9a5871381c Clean old messages before continuing bg idle work
Monitor folder checking operations so we can perform garbage collection
once any message detaching has finished. WIP as this is a second
mechanism for triggering GC after folder checks have completed. Need to
discuss.
2020-01-08 14:19:07 +01:00
Chris Heywood
f7ee234add Minor tidy on last commit 2020-01-08 14:15:07 +01:00
Chris Heywood
609ee01e3e Trigger idle cleanup per account when backgrounded
Also handle continuation of cleanup after old messages have been
detached. Flagged vacuuming is performed even when the cleanup
interval hasn't been reached. The tracking of last background
cleanup time in Account.Information is possibly temporary and isn't
yet persisted.
2020-01-08 14:08:52 +01:00
Chris Heywood
47bdda6af5 After GC reap check for a vacuum
The idea here being if we've just reduced prefetch period, reap has
detached a whole lot of messages and we want to vacuum. This check
catches that vacuum recommendation, flagging it to run when the app
is backgrounded and idle.
2020-01-08 13:02:22 +01:00
Chris Heywood
1e8465f555 Old message cleanup after folder becomes available
Simple mechanism for triggering GC reap after messages were removed
during folder check on becoming available
2020-01-08 12:58:54 +01:00
Chris Heywood
f7b0a0a61f Breakout ImapDB.Database garbage collection
Including:
- Moved into method run_gc
- Added ability to force reap (useful after old message cleanup when we
  don't want to wait the regular 10 day span)
- Added tracking of desire to vacuum, which will later by executed when
  backgrounded for a period
- Disabled vacuum on startup
- Added stopping IMAP while vacuuming
- Used ugly WIP hack of passing through account to stop IMAP
2020-01-08 12:21:27 +01:00
Chris Heywood
584ae84e5b Run GC after emptying spam or trash 2020-01-08 12:09:55 +01:00
Chris Heywood
ff6c45c29c Add minor missing cleanup
this.gc would previously never have been released if GC reap wasn't
recommended and run
2020-01-08 11:50:54 +01:00
Chris Heywood
15561a1108 Update local folder message count property during cleanup
Likely WIP with other properties to be added
2020-01-08 11:33:48 +01:00
Chris Heywood
cecf66df08 Track and notify messages detached during cleanup
Split detach query into two so that messages identifiers can be captured
which are then used to signal through that the folder has locally
removed messages
2020-01-08 11:31:25 +01:00
Chris Heywood
52bd48bab5 Signalling for locally removed messages 2020-01-08 11:04:51 +01:00
Mart Raudsepp
91f78fb411 build: Fix automagic dependency on ytnef library
It would be best to use meson feature option type for ytnef and unwind,
but for now fix the automagic dependency on ytnef with the existing
meson_options.txt setup.
It was adding ytnef to list of dependencies unconditionally, and then
also if tnef-support was enabled. So if the option was disabled, but the
pkg-config file was present, it would still link to it surprisingly.
Just remove the unconditional addition to dep, and rely on the already
existing conditional addition to deps.
2019-12-26 19:28:07 +02:00
Michael Gratton
e1295d2aa7 Fix crash in Geary.RFC822.Message.without_bcc
Second GMime workaround in that method no longer needed, and was causing
a crash, so remove it.
2019-12-21 18:23:40 +11:00
Chris Heywood
d77f5d9fcc Merge branch 'mainline' into remove-old-msgs-beyond-storage-pref 2019-12-18 12:09:53 +01:00
Chris Heywood
dbb1d783a1 Demote log message level 2019-12-18 12:08:24 +01:00
Torben
77d44d41a3 Merge branch 'mainline' into letorbi/gmime-3 2019-12-18 11:38:02 +01:00
Michael Gratton
77125fc17d Remove some redundant collection copies 2019-12-18 09:25:07 +11:00
Michael Gratton
cc0fb9eef2 Remove unused Geary.Folder::list_local_email_fields_async method 2019-12-18 09:25:07 +11:00
Michael Gratton
dda8d9baf1 Remove distinct search folder email identifiers
The only reason SearchFolder.EmailIdentifier exists was to store the
date for ordering the folder, but that can be done with any old class,
meaning we can simply pass though existing ImapDb ids to clients, fixing
a lot of bugs and corner cases along the way.
2019-12-18 09:25:07 +11:00
Michael Gratton
f025f6904d Move SearchFolder management into the client
Rename the search folder again to App.SearchFolder, move its id class
into it as an inner class. Remove search folder from the engine so the
application can manage it and it's policy in the future. Also remove
the outbox from the accout's list of local folders, so that code can
be removed altogether.
2019-12-18 09:25:07 +11:00
Chris Heywood
880df8691f Start towards clearing old messages beyond prefetch window
- Add custom optimised query to ImapDB.Folder and use in synchronizer
2019-12-17 12:43:55 +01:00
Torben
4374294400 Remove redundant call to set the GMime.Parser format; Add some comments 2019-12-17 12:16:06 +01:00
Torben
793f40fc4e Set default parser options directly after init 2019-12-16 15:05:47 +01:00
Torben
4677f4fe4a Check if header exists before reading value 2019-12-16 14:39:50 +01:00
Torben
c0e8f717e8 Allow addresses without domains (fixes disabled mailbox-addresses-test) 2019-12-16 00:34:30 +01:00
Torben
b0df4d5fd8 Return raw but unfolded header values (fixes message-test) 2019-12-16 00:31:07 +01:00
Torben
82c2b36c6e Make mailbox-address tests pass 2019-12-14 00:04:03 +01:00
Torben
5069556a7e Flush sinks of GMime filter streams 2019-12-13 21:35:33 +01:00
Michael Gratton
130fd95b86 Remove Geary.Account::search_upgrade_monitor
Implement the upgrade call as an account operation so the background
monitor takes care of reporting its progress.
2019-12-12 11:19:51 +11:00
Michael Gratton
924104c282 Clean up search folder implementation
Move SearchFolder and search EmailIdentifier implementation out of
ImapDb and into its own package. Decouple both from ImapDB, and improve
the implementation, fixing a few inefficiencies. Merge search
FolderProperties into the SearchFoldern implementation as an inner
class.

Merge SearchTerm into ImapDB.SearchQuery as an inner class and move the
outer class's source down a level, since it was the only file left in
the imap-db/search dir.
2019-12-12 10:47:52 +11:00
Michael Gratton
b3488f6cf9 Add Geary.Account::list_local_email_async
Add new method and implementation to support breaking search folder
impl out of the ImapDb package.
2019-12-12 10:47:52 +11:00
Michael Gratton
cb16bdc59d Remove default Geary.EmailIdentifier::hash and ::equal_to impls
Make subclasses implement these themselves and remove the unique string
property, to be (hopefully) more efficient and easier for subclasses
to specialise.
2019-12-12 10:47:52 +11:00