Commit Graph

109 Commits

Author SHA1 Message Date
a2a1838da4 mu-server: cleanup find prop handling
Rework the overly long find-handler.

Improve parsing of options, and return better return properties (for use
in mu4e).
2025-04-12 15:07:28 +07:00
8372be17dd mu-server: more info for mu4e-analyze-last-query
Include the search parameters besides the query.
2025-02-07 23:43:37 +02:00
aad5fc7df5 mu-server: minor cleanups 2025-02-05 21:07:14 +02:00
5f8e0b71f0 server: make parsed queries available to mu4e
Basically, make the "mu find .... --analyze" information available in
mu4e, through a function mu4e-server-last-query.

This is shows the query as the server saw it, as well as the parse
s-expressions. This can be useful to see how some query is interpreted.
2025-01-08 22:12:47 +02:00
d5d57b4327 remove non-single-threaded option
Single-threaded is the build-default, and seems to work well enough for
1.12.7, so remove the option to turn it off.

This is because build-options that influence such low-level/core
behavior are a pain to maintain.
2024-11-26 10:27:52 +02:00
d2343c6d62 mu-server: try avoiding xapian multi-threaded access
Try to avoid multi-threaded operations with Xapian.

This remove the thread workers during indexing, and avoids the indexing
background thread. So, mu4e has to wait once again during indexing.

We can improve upon that, but first we need to know if it avoids the
problem of issue #2756.
2024-10-08 11:23:04 +03:00
687db1aed6 mu-server: cosmetic 2024-08-21 06:19:35 +03:00
5bd439271d store-worker: temporarily revert
Of course, after merging some problems come up.
Let's fix those first.

This reverts commit f2f01595a5.
2024-06-05 12:21:24 +03:00
b4ff8d62af server: support doccount data request
So we can update doccount in mu4e after indexing
2024-06-03 21:01:17 +03:00
697d6b6b4f server: pass sexp-commmands through store worker
To ensure all Xapian rw commands happen in the same thread.
2024-06-03 21:01:17 +03:00
32bb79b316 draft: explicitly remove drafts after sending
This seems necessary in some cases.
2024-04-30 18:10:26 +03:00
6e8418bc64 mu-server: better handle msgid-not-found in move
It's opportunistic: messages referred to be msgid may not exist, and
that's okay.
2024-04-28 22:06:07 +03:00
5e8c7493d9 mu-server: get rid of the sent-handler
We no longer need it; we can handle mu4e's sending directly in
mu4e-compose.
2024-04-10 21:47:04 +03:00
9fd0d2be12 clang: fix some compiler warnings
From CI.
2024-03-15 19:47:30 +02:00
bae290e718 server: perform_move: throw when message not found
Warning & continuing is not the right thing...
2023-12-31 07:49:56 +02:00
1999d9e6ef compose: remove server-side handling
It's no longer needed: composition happens on the mu4e side only (until
a message is saved).
2023-12-29 23:23:13 +02:00
146b80113f lib: move transaction handling to mu-xapian
Instead of handling transactions in the store, handle it in xapian-db.
Make the code a bit more natural / cleaner-out

Handle transaction automatically (with a batch-size) and add some RAII
Transaction object, which makes all database interaction transactable
for the duration. So, no more need for explicit parameters to
add_message while indexing.
2023-12-22 21:24:41 +02:00
8bdf6b42a2 lib: debug-log moving / unlinking 2023-12-06 20:29:27 +02:00
2d20074b99 mu-move: add new move sub command
Add sub-command to move messages; add tests and docs.

Fixes #157
2023-09-24 17:29:08 +03:00
1df4452ff3 server: properly delete output-stream files
logic inversion
2023-09-20 21:35:55 +03:00
192c67262a lib: hide some code from coverage checking
Parts that are not easy / useful to unit-test
2023-09-11 23:51:37 +03:00
53c7381929 lib: move index/ into main lib/
simplify things a bit
2023-09-10 08:55:25 +03:00
f73aad2b41 better handle maildir cache
- get an updated maildir list after indexing
- add mu4e-added items to the list opportunistically

Remove mu4e-clear-caches / mu4e-cache-maildir-list to mu4e-obsolete.el

Fixes #2537.
2023-08-19 20:04:50 +03:00
1a1eb1f906 server: refactor allow-for-temp-file handling
Add a helper OutputStream class so both "normal" and temp-file code can
be handled uniformly.
2023-08-17 22:42:25 +03:00
a16d288c70 server: implement 'data' handler / maildirs
Add a new command 'data' for getting kinds of 'data'. There's one kind
for now: "maildirs". This retrieves the list as per Store::maildirs().
2023-08-17 22:42:25 +03:00
8caf504381 store: update "move" and some related APIs
Update test cases as well.
2023-08-17 22:42:25 +03:00
6168d776e1 server: fix contacts handler
Condition was b0rked; clean up code a bit.
2023-08-11 19:57:00 +03:00
01a516f0d3 server: tweak sexp generation 2023-08-06 16:19:43 +03:00
4945e699c8 lib/mu: use fmt-based time/date formatting
For a small speedup
2023-08-06 16:19:43 +03:00
6dfb2aae7b server: don't use structured-bindings / lambda for contacts_handler
Older clang doesn't like that.
2023-08-04 22:00:51 +03:00
75c37a506b server: don't use structured-bindings / lambda
Older clang doesn't like that.
2023-08-04 21:44:58 +03:00
f89e4c26d7 server: attempt to appease clang (pair/tuple)
https://stackoverflow.com/questions/46114214/lambda-implicit-capture-fails-with-variable-declared-from-structured-binding
2023-08-04 21:21:49 +03:00
aea95b5be0 mu-server: use strings, not sexps object (optimization)
When passing messages to mu, often we got a (parsed from string)
message-sexp from the message document; then appended some more
properties ("build_message_sexp").

Instead, we can do it in terms of the strings; this is _a little_
inelegant, but also much faster; compare:

(base)
[mu4e] Found 500 matching messages; 0 hidden; search: 1298.0 ms (2.60 ms/msg); render: 642.1 ms (1.28 ms/msg)

(with temp-file optimization (earlier commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 1152.7 ms (2.31 ms/msg); render: 270.1 ms (0.54 ms/msg)

(with temp file optimize _and_ the string opt (this commit)
[mu4e] Found 500 matching messages; 0 hidden; search: 266.0 ms (0.53 ms/msg); render: 199.7 ms (0.40 ms/msg)
2023-08-04 00:09:02 +03:00
924bb2145e mu-server: implement temp-file optimization
It can be faster to feed big mu -> mu4e data, such as contacts are
message headers through a temp-file instead directly though stdout;
implement this, and add the server parameter --allow-temp-file.

Implement this the "contacts" and "find" commands.
2023-08-04 00:09:02 +03:00
7b38f094c4 migrate some more code to mu_format / join_paths
Let's modernize a bit.
2023-07-20 23:14:29 +03:00
18490a818d store/server: centralize docids-for-msgid
No need for two near-identical impls

Remove some dead declarations.
2023-07-10 23:17:06 +03:00
4920b56671 update to use fmt-based apis
Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
2023-07-05 23:10:13 +03:00
c6fff6a281 all: update for API changes (config etc.)
Use the new & improved APIs.
2023-07-02 00:06:56 +03:00
fd7c011195 lib: update for api changes, update tests
With the new Sexp. And expand unit tests.
2023-06-27 00:53:23 +03:00
b41955b82a mu-server: improve error message 2023-04-11 21:31:13 +03:00
8762ac27dc mu: improve error numbers
Ensure they match what mu expects.
2023-04-11 20:47:48 +03:00
413a2564b6 server: don't encode addresses in contacts_handlers
Seems it doesn't always play nice with composer
2023-02-28 23:23:52 +02:00
3d4805de0c server: small output improvement
For human users.
2023-02-17 10:20:14 +02:00
76fedf4d64 mu-server: make :update for mkdir optional
It's useful to do "opportunistic" mkdir form mu4e; don't send updates in
that case (i.e. with :update nil)
2023-02-12 11:16:47 +02:00
29dc90486b server: find_handler: better handle sort-field-id
Handle invalid sort-fields correctly.
2023-01-29 10:13:29 +02:00
4271fc2fb6 really allow flags to be empty in move command
Without this patch, I see the following error:

;; mu> (move :docid 1 :maildir "/.Archive")
[2b](:error 32818 :message "invalid flags ''")

flags should not default to "", which is not a valid flags string.
2023-01-25 16:31:41 -05:00
201fe45edc server: add a few stopwatches
For measuring performance.
2023-01-19 22:37:50 +02:00
ef2ec7d5a5 server: split off new server command 'queries'
Instead of being part of the ping command, create a separate
queries command, which is easier for updating. Ie. 'ping' implies "show
main screen" but we don't always want that side-effect.
2023-01-07 15:40:30 +02:00
b71751a185 mu-server: update for move_message API update 2022-12-07 18:22:29 +02:00
64f08149bc lib: remove mu-runtime
Remove runtime; update the logger for that, and move the runtime-paths
stuff to utils.
2022-11-16 23:31:51 +02:00