add status value to _notmuch_message_ensure_metadata

Gaute Hope eg at gaute.vetsj.com
Wed Feb 22 23:46:29 PST 2017


David Bremner writes on februar 23, 2017 1:58:
> Gaute Hope <eg at gaute.vetsj.com> writes:
> 
>> Gaute Hope writes on februar 20, 2017 10:27:
>>> David Bremner writes on februar 18, 2017 15:45:
>>>> In id:1487339566.mz8acpov1j.astroid at strange.none , Gaute provided a
>>>> traceback of an uncaught Xapian::DatabaseModifiedError. The fix for
>>>> this is simple, but somewhat intrusive.
>>>>
>>>> [...]
>>>>
>>>> I haven't tested against Gaute's test case (needs more boost than I
>>>> have handy).
>>
>> Alright then, attached is a non-boost version that takes a notmuch db
>> path (absolute) as the first argument (no warranty).
>>
> 
> With the patches above this crashes in a predictable / preventable way,
> because notmuch_message_get_tags returns NULL. It isn't clear to me yet
> what the best API choice is here: minimize difference with the old API
> by returning NULL to indicate errors, or switch completely to the
> pattern of e.g. notmuch_query_search_messages_st. I suppose we could do
> something along the same lines and add new _st versions of the
> problematic functions
> 

Hi,

Ideally if the error could be caught in `notmuch_threads_valid` or
`notmuch_threads_get_thread` I think that would be the clearest, _st
versions would be nice. As I mentioned in
id:1487582192.57s86yczcg.astroid at strange.none it seems that at later
arbitrary iterations (without re-loading the threads object) the
functions return valid data (even `notmuch_thread_get_tags` does). Can
this data be trusted? I feel like this should all be invalid at this
point.

Regards, Gaute



More information about the notmuch mailing list