aboutsummaryrefslogtreecommitdiff
path: root/test/T641-database-modified-messages.sh
AgeCommit message (Collapse)Author
2025-07-24lib: handle DatabaseModifiedError in _notmuch_message_createAnton Khirnov
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 <david@tethera.net> [replace use of notmuch_messages_valid]
2025-07-06test: add another known broken test for uncaught DatabaseModifiedErrorAnton Khirnov
This one is raised from _notmuch_message_create(). See also https://github.com/pazz/alot/issues/1460#issuecomment-2994101019