Commit Graph

93 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 5367122c08 store: support reinit
Support reinitializing, based on some current store. This is useful for
upgrading. Note that this is only the backend implementation + tests.
2022-10-02 18:24:23 +03:00
Dirk-Jan C. Binnema 97459beed9 maildir: improve testing coverage
Remove some dead/unused code. Update docs. Add test cases.
2022-06-29 22:19:26 +03:00
Dirk-Jan C. Binnema ce1fea6302 store: log whether a message is 'personal' 2022-05-30 20:31:23 +03:00
Dirk-Jan C. Binnema cea3167f3e lib: remove some dead code (mu-str/utils)
Remove unused library code; recycle some electrons.
2022-05-19 23:38:49 +03:00
Dirk-Jan C. Binnema 9af9d0fa94 indexer/store: avoid completed callback
This cause havoc / race conditions.
2022-05-18 20:16:48 +03:00
Dirk-Jan C. Binnema c3778cd467 store: reset indexer in dtor
Clear it up as soon as possible.
2022-05-18 18:24:30 +03:00
Dirk-Jan C. Binnema 0be54119d8 store: stop indexer in dtor 2022-05-18 18:07:19 +03:00
Dirk-Jan C. Binnema 6e37790012 mu: improve error reporting 2022-05-15 13:40:44 +03:00
Dirk-Jan C. Binnema 201acfbbd3 store: add lock to index_complete
It must be protected.
2022-05-12 23:23:47 +03:00
Dirk-Jan C. Binnema d79d770958 store: improve error handling
Detect store-lock
2022-05-12 08:56:13 +03:00
Dirk-Jan C. Binnema 2e9666af0b store/info: Gather some usage statistics
Keep track of the latest-change/latest-index.
2022-05-10 08:16:47 +03:00
Dirk-Jan C. Binnema 80d84bf635 store: use Result<Store> builder, add auto upgrade
Make it a Result type, and add auto-upgrade (not enabled yet)
Update dependents.
2022-05-09 22:25:28 +03:00
Dirk-Jan C. Binnema dc69505580 mu-maildir: No need for namespaced function names
Mu::mu_maildir_... -> Mu::maildir_...
2022-05-09 22:25:28 +03:00
Dirk-Jan C. Binnema 6126d7ee62 store: ensure updates update message sexp too
And turn all "add" into "replace" so old messages get removed.
Update tests too.
2022-05-05 01:40:17 +03:00
Dirk-Jan C. Binnema ee4b3bda2d message: support 'personal' flag for messages
Add a new flag 'personal' for a message, which means that at least one of the
contact fields is personal.
2022-05-05 01:38:25 +03:00
Dirk-Jan C. Binnema fea596ae3b message/field: cache the message's sexp
Keep it in the store; much faster than generating on the fly.
2022-05-05 01:38:25 +03:00
Dirk-Jan C. Binnema 9e0173f387 store: set XAPIAN_FLUSH_THRESHOLD above internal commit
Don't auto-flush more often than the internal handling.
2022-05-05 01:38:25 +03:00
Dirk-Jan C. Binnema 525fef479a store: update to use Message; big cleanup
Remove much of the message processing from the store
2022-04-30 10:40:45 +03:00
Dirk-Jan C. Binnema 9b8353fc37 lib: update Store & QueryResults in terms of Mu::Message 2022-04-30 10:40:45 +03:00
Dirk-Jan C. Binnema 27ebfb3b3c lib+guile: use Mu::Option, not std::optional
We need the extensions, and/or let's use _one_ optional implementation everywhere.
2022-03-28 08:58:04 +03:00
Dirk-Jan C. Binnema 8ed09a9a82 store: cosmetics 2022-03-26 17:19:10 +02:00
Dirk-Jan C. Binnema f7c84006d7 many: update for lib/message updates
Adapt to the new names / directory. Big commit, but mostly just very boring renaming.
2022-03-26 17:19:10 +02:00
Dirk-Jan C. Binnema 7f15767faf message: fields: rationalize flags
Improve naming.
2022-03-26 17:19:10 +02:00
Dirk-Jan C. Binnema 056fecd6aa store::for_each_term: use field-id
We were trying to convert a field (string) to a xapian prefix back to a
field (enum). That's unnecessarily complicated and worse, step 2 won't work.
2022-03-14 09:38:59 +02:00
Dirk-Jan C. Binnema a8654a616a lib/store: use mu-message-fields 2022-03-07 06:50:18 +02:00
Dirk-Jan C. Binnema 7822d2633e update contacts-cache users for MessageContact
Since contacts-cache now uses MessageContact, update its users
2022-02-21 23:51:46 +02:00
Dirk-Jan C. Binnema a82bd77d09 lib: rename contacts into contacts-cache
Plus dependents.
2022-02-21 23:22:42 +02:00
Dirk-Jan C. Binnema 39c45abc38 mu-store: use Mu::MessageContact
Use the new contact class. And a lot of whitespace cleanups.
2022-02-21 23:22:42 +02:00
Dirk-Jan C. Binnema 8cea933a51 mu-store: take mu_util_get_hash
mu-store is the only user left, move the implementation there.
2022-02-19 19:09:25 +02:00
Dirk-Jan C. Binnema c0da564bba lib: fix clang compatibility / warnings 2022-02-18 10:49:56 +02:00
Dirk-Jan C. Binnema 831d26052a store: expose the mutex so we can lock query-results
The QueryResults must not outlive the lock (when in a MT context), so expose for
clients (mu-server) to handle it.
2022-02-17 23:49:17 +02:00
Dirk-Jan C. Binnema f6f17d5d6b *: update code for Mu::MessageFlags
Migrate the code to use the new niceness
2022-02-17 23:48:59 +02:00
Dirk-Jan C. Binnema 3086238b33 store: expose metadata()/set_metadata()
Allow for storing metadata in the database, and consider the cache.
2022-02-14 11:12:26 +02:00
Dirk-Jan C. Binnema 3820118246 store: rename "metadata" into "properties"
properties are the constant (for the duration) values for a store; metadata may
change, so reserve that name for that.
2022-02-14 11:12:26 +02:00
Dirk-Jan C. Binnema 23fc8bdba8 update code for Mu::MessagePriority
Update dependent code
2022-02-14 11:12:26 +02:00
Dirk-Jan C. Binnema 43c44cf6cd store: catch dtor exception 2022-02-07 22:34:49 +02:00
Dirk-Jan C. Binnema 77bca5463f store: don't lock for_each_term
It's only called from the parser with a store, and when we _already_
hold the lock.
2022-02-05 08:44:43 +02:00
Dirk-Jan C. Binnema 05393ba797 index: save/commit metadata after messages
Ensure the metadata (dirstamps) for messages are only written / committed _after_
the accompanying message have been written / committed.

This avoids missing updates when indexing gets terminated unexpectedly.
2022-02-03 23:04:18 +02:00
Dirk-Jan C. Binnema 5fc8a8f83e store/query: access query only through store
Make Mu::Query only accessible through store, so we can lock the db for the
duration of a (full, multipass) query.
2022-01-30 14:52:41 +02:00
Dirk-Jan C. Binnema f035c801bb store: save contacts more often
Use the new Contacts::dirty() so serialize/save the contacts whenever we commit
a transaction.

And some cosmetics.
2022-01-15 15:12:38 +02:00
Dirk-Jan C. Binnema 4f02702510 store: add catch blocks for dirstamp/set_dirstamp 2021-12-18 15:22:52 +02:00
Dirk-Jan C. Binnema 4c0d8572d8 store/indexer: move transaction handling to store
Move the transaction handling code inside Store, simplifying the indexer.
2021-11-09 22:43:11 +02:00
Dirk-Jan C. Binnema 8028f88a51 mu: rework xapian dependencies a bit
Reduce the places where we need to include Xapian, and add a few places where
the (meson build) didn't explicitly have a Xapian dep where needed.
2021-11-03 12:34:08 +02:00
Dirk-Jan C. Binnema 89014ecd06 index/store: simplify transaction handling
only have transactions for indexing, and make it opportunistic. All other ops do
not use transactions.
2021-10-20 20:14:25 +03:00
Dirk-Jan C. Binnema 3dd721d5a3 clang-format: update c/cc coding style
Update all cc code using .clang-format; please do so as well for future PRs
etc.; emacs has a handy 'clang-format' mode to make this automatic.

For comparing old changes with git blame, we can disregard this one using
--ignore-rev

(see https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame )
2021-10-20 12:26:16 +03:00
Dirk-Jan C. Binnema 49637dbc3a lib: replace CATCH_BLOCK macros with template magic 2021-10-18 21:52:37 +03:00
Dirk-Jan C. Binnema 672d0c7238 store: don't try to commit when there's no transaction
Avoids some error warning.
2021-10-16 11:15:19 +03:00
Dirk-Jan C. Binnema 78ef8ddcbb mu-store: fix warning schema mismatch message
Fixes: #2069.
2021-07-31 17:54:33 +03:00
Dirk-Jan C. Binnema fd9cc6bcc4 mu-store: improve database schema error
Tell user they should mu-init
2021-07-31 01:47:21 +03:00
Dirk-Jan C. Binnema 34fae2c072 mu-store: update whitespace 2021-07-31 01:45:22 +03:00