summaryrefslogtreecommitdiffstats
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-03 08:52:21 +0200
committerDanilo M. <danix@danix.xyz>2026-08-03 08:52:21 +0200
commit9564794135c3a90fc3988e42233adfd819c5881d (patch)
tree41ae191a21dfa8bf160c9f9e6583a070037311fa /tests/CMakeLists.txt
parentee1b05e2c0f3a5bcb86b2531951337f48bc66c23 (diff)
downloadqtmaildir-9564794135c3a90fc3988e42233adfd819c5881d.tar.gz
qtmaildir-9564794135c3a90fc3988e42233adfd819c5881d.zip
feat: add NotmuchWorker with batched queries and tag mutation
Owns the only notmuch database handle. Queries run read-only and emit threads in batches of 200 with a generation counter so the UI can discard superseded results. Tag mutation closes the read-only handle, opens read-write, applies, and closes, holding the process-wide write lock for milliseconds rather than blocking a concurrent `notmuch new`. Tested against a throwaway database built in a QTemporaryDir, superseding the spec's original "no unit test" position: applyTags is the only code here that writes to a notmuch index. The fixture never touches ~/Mail or ~/.notmuch-config. Two fixes against the drafted implementation, both caught by mutating the code and confirming exactly one test failed: - loadThread conflated "no query given" with "query matched nothing in this thread", so filtering a thread down to zero matches rendered every message expanded. Tracked with an explicit haveMatchSet flag. - applyTags now documents why a stale message id must skip rather than abort: notmuch_database_find_message reports SUCCESS with a null message for an unknown id, and the live ids alongside it still need tagging. Note for fixture authors: notmuch synchronizes maildir flags with tags at index time, so a file named `...:2,S` is indexed without the unread tag no matter what [new] tags requests. Unread fixture messages go in new/. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d0faeec..a24a60b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -12,3 +12,4 @@ target_compile_definitions(test_mimeparser PRIVATE
FIXTURE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/fixtures")
add_qtmaildir_test(interceptor)
add_qtmaildir_test(htmlbuilder)
+add_qtmaildir_test(notmuchworker)