<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/message.cc, branch debian/unstable</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=debian%2Funstable</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=debian%2Funstable'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2026-01-14T22:18:24Z</updated>
<entry>
<title>lib: move call to _n_m_invalidate_metadata</title>
<updated>2026-01-14T22:18:24Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2024-09-01T15:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=8f9e16f2b9a46bef2c7398a27ff29db7bb23ee8d'/>
<id>urn:sha1:8f9e16f2b9a46bef2c7398a27ff29db7bb23ee8d</id>
<content type='text'>
It is wrong most of the time in _notmuch_message_remove_terms, but
that function is too low level to know how to call
_n_m_invalidate_metadata with the right argument, at least not without
more extensive changes. This change merely makes the current behaviour
more obvious, since the other calls cannot have relied on metadata
being invalidated.
</content>
</entry>
<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/message: check message type before deleting document</title>
<updated>2023-07-22T10:11:46Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2023-07-20T12:08:00Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=d93d49b6aed5b3f71651ffe79225da08c7d8f1aa'/>
<id>urn:sha1:d93d49b6aed5b3f71651ffe79225da08c7d8f1aa</id>
<content type='text'>
It isn't really clear how this worked before. Traversing the terms of
a document after deleting it from the database seems likely to be
undefined behaviour at best
</content>
</entry>
<entry>
<title>lib/message-property: sync removed properties to the database</title>
<updated>2023-03-30T11:01:09Z</updated>
<author>
<name>Kevin Boulain</name>
<email>kevin@boula.in</email>
</author>
<published>2023-03-29T16:13:32Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=fb55ff28a2fdaa9c218af5ca10b1cae674869edd'/>
<id>urn:sha1:fb55ff28a2fdaa9c218af5ca10b1cae674869edd</id>
<content type='text'>
_notmuch_message_remove_all_properties wasn't syncing the message back
to the database but was still invalidating the metadata, giving the
impression the properties had actually been removed.

Also move the metadata invalidation to _notmuch_message_remove_terms
to be closer to what's done in _notmuch_message_modify_property and
_notmuch_message_remove_term.
</content>
</entry>
<entry>
<title>lib: add better diagnostics for over long filenames.</title>
<updated>2023-02-20T13:22:32Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-12-27T17:08:47Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=09f2ad8e853375930c63bca847f623bc722b9cc0'/>
<id>urn:sha1:09f2ad8e853375930c63bca847f623bc722b9cc0</id>
<content type='text'>
Previously we just crashed with an internal error. With this change,
the caller can handle it better. Update notmuch-new so that it doesn't
crash with "unknown error code" because of this change.
</content>
</entry>
<entry>
<title>lib/message: move xapian call inside try/catch block in _n_m_delete</title>
<updated>2022-12-27T15:59:46Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-12-04T02:28:57Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=1d5d0ae68689e7b1d6b974e275f19371250c4b25'/>
<id>urn:sha1:1d5d0ae68689e7b1d6b974e275f19371250c4b25</id>
<content type='text'>
The call to delete_document can throw exceptions (and can happen in
practice [1]), so catch the exception and extract the error
message. As a side effect, also move the call to _n_m_has_term inside
the try/catch. This should not change anything as that function
already traps any Xapian exceptions.

[1]: id:wwuk039sk2p.fsf@chaotikum.eu
</content>
</entry>
<entry>
<title>lib: check for writable db in n_m_tags_maildir_flags</title>
<updated>2022-06-25T19:06:34Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-05-25T10:51:17Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=6f749dd24a1c8138a05ac92884e8cb71098c7f6e'/>
<id>urn:sha1:6f749dd24a1c8138a05ac92884e8cb71098c7f6e</id>
<content type='text'>
The database needs to be writable because the list of stored file
names will change in general.
</content>
</entry>
<entry>
<title>lib/message: check return status from _n_m_add_{path,folder}_terms</title>
<updated>2022-06-25T15:55:02Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-05-23T23:39:00Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=879ec9d76ad5caeb728c3f047d1da425d0b511eb'/>
<id>urn:sha1:879ec9d76ad5caeb728c3f047d1da425d0b511eb</id>
<content type='text'>
Mainly to propagate information about Xapian exceptions.
</content>
</entry>
<entry>
<title>lib/message: check return status of _n_m_{add,remove}_term</title>
<updated>2022-06-25T15:55:02Z</updated>
<author>
<name>David Bremner</name>
<email>david@tethera.net</email>
</author>
<published>2022-05-23T23:38:59Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=b102d0ad11a3b4c605f6561fcfa93805b0e7d712'/>
<id>urn:sha1:b102d0ad11a3b4c605f6561fcfa93805b0e7d712</id>
<content type='text'>
Xapian exceptions are not something that can be ignored, in general.
</content>
</entry>
</feed>
