<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/database.cc, branch 0.40</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.40</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.40'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2025-08-09T10:12:23Z</updated>
<entry>
<title>lib: return NOTMUCH_STATUS_OPERATION_INVALIDATED where appropriate</title>
<updated>2025-08-09T10:12:23Z</updated>
<author>
<name>Anton Khirnov</name>
<email>anton@khirnov.net</email>
</author>
<published>2025-08-06T05:43:06Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=aa761727999b105711ba4ca789e0836a0a05cf9f'/>
<id>urn:sha1:aa761727999b105711ba4ca789e0836a0a05cf9f</id>
<content type='text'>
The overall goal is to allow clients to restart operations in
situations where that is the response recommended by the underlying
Xapian library.

Amended-by: db, added above explanation
</content>
</entry>
<entry>
<title>lib: handle DatabaseModifiedError in _notmuch_message_create</title>
<updated>2025-07-24T10:30:58Z</updated>
<author>
<name>Anton Khirnov</name>
<email>anton@khirnov.net</email>
</author>
<published>2025-07-07T12:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=f375ea1add121c428f261473512831a169dfe335'/>
<id>urn:sha1:f375ea1add121c428f261473512831a169dfe335</id>
<content type='text'>
If an open database is modified sufficiently by other callers, the open
instance becomes invalid and operations on it throw
DatabaseModifiedError. Per Xapian documentation, the caller is then
supposed to reopen the database and restart the query. This exception is
currently not handled in _notmuch_message_create(), leading to the
default handler abort()ing the process.

Catch this exception in _notmuch_message_create() and return an error
instead of crashing. Since the entire query becomes invalid - including
results that have already been read by the caller - this situation
cannot be handled by libnotmuch transparently. A new public function -
notmuch_messages_status() - is added to allow the callers to check
whether the messages iterator was exhausted or terminated early due to
a runtime error. This also allows memory allocation failure to be
signalled to the caller.

Amended-By: David Bremner &lt;david@tethera.net&gt;
            [replace use of notmuch_messages_valid]
</content>
</entry>
<entry>
<title>lib/n_d_remove_message: do not remove unique filename</title>
<updated>2023-07-22T10:15:59Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2023-07-20T12:08:01Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=b6f144abe1f5aa3519240cf52f4cb9907fefcd0e'/>
<id>urn:sha1:b6f144abe1f5aa3519240cf52f4cb9907fefcd0e</id>
<content type='text'>
It is wasteful to remove a filename term when the whole message
document is about to be removed from the database. Profiling with perf
shows this takes a significant portion of the time when cleaning up
removed files in the database.

The logic of n_d_remove_message becomes a bit more convoluted here in
order to make the change minimal.

It is possible that this function can be further optimized, since the
expansion of filename terms into filenames is probably not needed
here.
</content>
</entry>
<entry>
<title>lib: index attachments with mime types matching index.as_text</title>
<updated>2023-04-02T22:24:43Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2023-01-06T00:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=a554690d6af0ac8cb55166a20efd0f449abde389'/>
<id>urn:sha1:a554690d6af0ac8cb55166a20efd0f449abde389</id>
<content type='text'>
Instead of skipping indexing all attachments, we check of a (user
configured) mime type that is indexable as text.
</content>
</entry>
<entry>
<title>lib/database: propagate status code from _notmuch_message_delete</title>
<updated>2022-12-27T15:59:29Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-12-04T02:28:55Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=16d92abf9f3326da1ec0c6f84c2c8876efc77ecb'/>
<id>urn:sha1:16d92abf9f3326da1ec0c6f84c2c8876efc77ecb</id>
<content type='text'>
_notmuch_message_delete can return (at least)
NOTMUCH_STATUS_XAPIAN_EXCEPTION, which we should not ignore.
</content>
</entry>
<entry>
<title>lib: add NOTMUCH_STATUS_CLOSED_DATABASE, use in _n_d_ensure_writable</title>
<updated>2022-06-25T19:06:18Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-05-25T10:51:16Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=3f27cce71f9f154cb0c2134c32d41c31eb62a239'/>
<id>urn:sha1:3f27cce71f9f154cb0c2134c32d41c31eb62a239</id>
<content type='text'>
In order for a database to actually be writeable, it must be the case that it
is open, not just the correct type of Xapian object. By explicitely
checking, we are able to provide better error reporting, in particular
for the previously broken test in T566-lib-message.
</content>
</entry>
<entry>
<title>lib/database: delete stemmer on destroy</title>
<updated>2022-01-23T01:14:29Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-01-09T14:38:05Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=2786aa4d548d28579c761e9358d44c84dfb29068'/>
<id>urn:sha1:2786aa4d548d28579c761e9358d44c84dfb29068</id>
<content type='text'>
Commit [0] left the stemmer object accessible, but did not add
de-allocation code to notmuch_database_destroy. This commit corrects
that oversight.

Leak originally reported by Austin Ray [1].

[0]: 3202e0d1feba1ab955ba1c07098c00208f8f0ada
[1]: id:20220105224538.m36lnjn7rf3ieonc@athena
</content>
</entry>
<entry>
<title>lib/open: no default mail root in split configurations</title>
<updated>2022-01-15T19:59:39Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-12-25T13:33:05Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=fad2e7540bf9309bfb335650ded753e9ed085eff'/>
<id>urn:sha1:fad2e7540bf9309bfb335650ded753e9ed085eff</id>
<content type='text'>
If we know the configuration is split, but there is no mail root
defined, this indicates a (lack of) configuration error. Currently
this can only arise in XDG configurations.
</content>
</entry>
<entry>
<title>lib/compact: replace deprecated notmuch_database_open_verbose</title>
<updated>2021-10-30T18:04:00Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-10-23T12:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=c7705fb95e2f5d11fabb7b6a07f7b7558e0928e6'/>
<id>urn:sha1:c7705fb95e2f5d11fabb7b6a07f7b7558e0928e6</id>
<content type='text'>
It should not be necesary to have any config information here, hence
passing "" to n_d_open_with_config.
</content>
</entry>
<entry>
<title>lib: add new status code for query syntax errors.</title>
<updated>2021-09-05T00:07:19Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2021-08-24T15:17:15Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9ae4188610dc21101fe9bdeb158854fc7c63463e'/>
<id>urn:sha1:9ae4188610dc21101fe9bdeb158854fc7c63463e</id>
<content type='text'>
This will help provide more meaningful error messages without special
casing on the client side.
</content>
</entry>
</feed>
