Re: add status value to _notmuch_message_ensure_metadata

Subject: Re: add status value to _notmuch_message_ensure_metadata

Date: Wed, 22 Feb 2017 20:58:30 -0400

To: Gaute Hope, notmuch@notmuchmail.org

Cc:

From: David Bremner


Gaute Hope <eg@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@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

Thread: