aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_tagrules.cpp
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-25 12:46:31 +0200
committerDanilo M. <danix@danix.xyz>2026-08-25 12:46:31 +0200
commitb1db3e878a6fb468dc2c572c7080c572e3bd1ac5 (patch)
tree181d2207b4810874afd65a7230e2e73a93a99291 /tests/test_tagrules.cpp
parent8b26c3e83a0328adb3f24d808b629fb73250d377 (diff)
downloadqtmaildir-b1db3e878a6fb468dc2c572c7080c572e3bd1ac5.tar.gz
qtmaildir-b1db3e878a6fb468dc2c572c7080c572e3bd1ac5.zip
fix(worker): reopen the notmuch handle so queries see new mail
A read-only notmuch handle is a Xapian snapshot taken when it is opened, so it never observes a write made by another process afterwards. The worker opened one handle and kept it for the process lifetime, which made the sync script's `notmuch new` invisible: every query after startup was answered from the index as it stood when the application launched. The symptom was mail arriving while the window was open and not appearing until a restart. It was not confined to the post-sync refresh, which is what made it hard to place: a query typed by hand also found nothing, since it hits the same handle. Tag writes were unaffected throughout, because applyTags opens its own read-write handle per call. Reopen in openReadOnly() rather than at each call site: every read path begins by asking for the handle. A reopen failure is deliberately not fatal, since the existing handle is still usable and answering from a slightly stale index beats refusing to answer. The suite could not reproduce this before: the test helper builds a fresh worker per query, so it opens a fresh handle every time. The new test holds one worker across two queries and indexes between them from a second process. Item 104.
Diffstat (limited to 'tests/test_tagrules.cpp')
0 files changed, 0 insertions, 0 deletions