aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-07-22test: add known broken test for n_d_get_default_indexoptsDavid Bremner
Xapian exceptions are swallowed and turned into default return value.
2020-07-22lib: fix error return bug with n_d_set_config.David Bremner
The catch block either needs to return, or the function needs to return "status". Choose the latter for consistency with n_d_get_config.
2020-07-22test: add known broken test for n_d_set_configDavid Bremner
Error status is currently lost.
2020-07-22test: add regression test for n_d_get_configDavid Bremner
Xapian exceptions seem to handled OK, at least for this case.
2020-07-22lib: add regresion test for n_d_get_all_tagsDavid Bremner
Existing error handling seems adequate, if not ideal.
2020-07-22lib: add regression test for n_d_find_message_by_filenameDavid Bremner
At least this Xapian exception is caught. Make sure it stays that way.
2020-07-22lib: rename _n_d_create to _n_d_find_or_createDavid Bremner
The error message and name were confusing when called in some "read only" context.
2020-07-22test: add known broken test for notmuch_database_remove_messageDavid Bremner
The current error message is a bit confusing; fix in next commit.
2020-07-22lib: convert relative filenames to absolute in n_d_index_fileDavid Bremner
The API docs promise to handle relative filenames, but the code did not do it. Also check for files outside the mail root, as implied by the API description. This fixes the bug reported at id:87sgdqo0rz.fsf@tethera.net
2020-07-22test: add known broken test for indexing relative pathDavid Bremner
The current code seems to look for the path relative to the current working directory, rather than the mail store root.
2020-07-22test: regression test for n_d_index_file closed dbDavid Bremner
Current exception handling seems OK, at least for this case.
2020-07-22test: add regression test for n_d_get_directoryDavid Bremner
At least this exception is already handled correctly.
2020-07-22test: regression test for n_d_get_revisionDavid Bremner
This function only accesses data cached by notmuch, so being closed is not a problem.
2020-07-22test: add regression test for n_d_{begin,end}_atomicDavid Bremner
Xapian currently succeeds to begin/end a transaction on a closed database, or at least does not throw an exception. Make the test robust against this changing.
2020-07-22test: regression test for n_d_upgradeDavid Bremner
The logic is that if it's acceptable to return SUCCESS for read only database, it's acceptable for a closed one.
2020-07-22lib/n_d_needs_upgrade: handle error return from n_d_get_versionDavid Bremner
Also clarify documentation of error return from n_d_needs_upgrade.
2020-07-22test: add known broken test for n_d_needs_upgradeDavid Bremner
It's a bit arbitrary which value to return for errors, but the same argument as for read only databases applies for errors.
2020-07-22test: add regression tests for notmuch database destroyDavid Bremner
Either an open or closed database should be ok to destroy
2020-07-22test: regression test for closing a closed databaseDavid Bremner
This does not currently throw an error, and it should stay that way.
2020-07-22lib/n_d_get_version: catch exceptions and clarify the APIDavid Bremner
notmuch_database_get_version previously returned 0 on some errors, but did not document this. Luckily 0 is not a valid database version.
2020-07-22lib: move deallocation of memory from n_d_close to n_d_destroyDavid Bremner
In order to mimic the "best effort" API of Xapian to provide information from a closed database when possible, do not destroy the Xapian database object too early. Because the pointer to a Xapian database is no longer nulled on close, introduce a flag to track whether the notmuch database is open or not.
2020-07-22test: add known broken test for n_d_get_version on closed dbDavid Bremner
This should not crash, but it does currently.
2020-07-22test: regression tests for n_d_status_string and n_d_get_pathDavid Bremner
These do not crash on a closed database, and we want to keep it that way. Start a new file of tests as T560-lib-error was starting to get unwieldy.
2020-07-22lib: fix exception messages for n_m_message_*David Bremner
The original generic handler had an extra '%s' in the format string. Update tests that failed to catch this because the template to print status strings checked 'stat', which was not set.
2020-07-22test: sanitize line numbers in exception reportsDavid Bremner
Prevent test suite churn when reported line numbers change.
2020-07-22emacs: notmuch-search: avoid wiping out buffer-local variablesSean Whitton
2020-07-20lib: fix return value for n_m_reindexDavid Bremner
Also update the documentation for the behaviour of n_m_get_thread_id that this fix relies on.
2020-07-20test: add known broken test for n_m_reindex on closed dbDavid Bremner
This is another case where the code should not call INTERNAL_ERROR.
2020-07-20test: regression for retrieving closed db from messageDavid Bremner
This is actually one of the few potentially useful things you can do with a message belonging to a closed database, since in principle you could re-open the database.
2020-07-20test: regression test for destroying message with closed dbDavid Bremner
This should be fine because the message belongs to the database (talloc context wise).
2020-07-20test: regression tests of n_m_freeze and n_m_thaw on closed dbDavid Bremner
Neither of these accesses the database, so should be safe. Add the tests to catch any changes in exception throwing.
2020-07-20lib: handle xapian exception in n_m_remove_all_tagsDavid Bremner
At least the exception we already catch should be reported properly.
2020-07-20test: add broken test for n_m_remove_all_tagsDavid Bremner
The Xapian exception is actually caught here, but the NULL return is not dealt with properly.
2020-07-20test: add regression test for n_m_maildir_flags_to_tagsDavid Bremner
This function currently catches at least the obvious Xapian exceptions and we want to keep it that way.
2020-07-20cli/new: replace newly deprecated n_m_has_maildir_flagDavid Bremner
Boolean return values have no out-of-band-values to signal errors. The change here is that a (somewhat unlikely) fatal error after indexing will now be caught.
2020-07-20lib: add notmuch_message_has_maildir_flag_stDavid Bremner
Initially the new function is mainly tested indirectly via the wrapper.
2020-07-20test: add regression test for notmuch_message_has_maildir_flagDavid Bremner
This passes the NULL return inside _ensure_maildir_flags does not break anything. Probably this should be handled more explicitely.
2020-07-18configure: replace multiple redirects with redirected blockDavid Bremner
This belatedly implements Tomi's suggestion from id:m25zaukv6u.fsf@guru.guru-group.fi
2020-07-18bindings/ruby: replacy use of deprecated notmuch_message_get_flagDavid Bremner
Depending on the flag, this actually can return an errror, so raise a ruby exception if so.
2020-07-18lib/thread: replace use of deprecated notmuch_message_get_flagDavid Bremner
This adds one more reason why _notmuch_thread_create might return NULL, but those were not previously enumerated, so no promises are broken.
2020-07-18lib/add-message: drop use of deprecated notmuch_message_get_flag.David Bremner
As a side effect, we revert the switch from notmuch_bool_t to bool here. This is because those two types are not actually compatible when passing by reference.
2020-07-18cli/show: replace deprecated notmuch_message_get_flagDavid Bremner
This can be seen as moving an abort out of the library, into the CLI where we can both print to stderr and shut the process down without ill effect.
2020-07-18cli/search: replace deprecated notmuch_message_get_flagDavid Bremner
Our handling of errors is all or nothing here, but it's an improvement on the status quo, and it avoids rippling internal API changes.
2020-07-18lib: catch exceptions in n_m_get_flag, provide n_m_get_flag_stDavid Bremner
It's not very nice to return FALSE for an error, so provide notmuch_message_get_flag_st as a migration path. Bump LIBNOTMUCH_MINOR_VERSION because the API is extended.
2020-07-16configure: make sure WITH_PYTHON_DOCS is initializedDavid Bremner
Thanks to pazz for reporting the problem.
2020-07-15doc: add new python bindings to main documentation tree.David Bremner
A separate conf.py and doc directory (or will be needed if someone wants to build the bindings docs separately from notmuch.
2020-07-15doc: replace use of environment variables with a generated configDavid Bremner
It is getting unwieldy to pass configuration options on the sphinx-build command line, and I anticipate further use of conditionals. As far as I could tell, execing a string is the idiomatic way to emulate include in Python.
2020-07-14lib: use COERCE_STATUS in n_m_{add,remove}_tagDavid Bremner
Currently I don't know of a good way of testing this, but at least in principle a Xapian exception in _notmuch_message_{add,remove}_term would cause an abort in the library.
2020-07-14lib: catch Xapian exceptions in n_m_remove_tagDavid Bremner
The churn here is again mainly re-indentation.
2020-07-14test: add broken test for n_m_remove_tagDavid Bremner
Exception will be caught in next commit.