Bug: counting messages twice after excluding tags yields different results

David Bremner david at tethera.net
Sun Mar 5 03:41:19 PST 2017


Lucas <luc.lists at gmail.com> writes:

> Dear list members,
>
> I think I found a bug or at least undocumented behaviour in the notmuch
> library.  I would like to report this here.  Originally I found the bug
> in the python library but I attached a c program that shows the same
> behaviour.  I am running notmuch version 0.22.1 from the Arch Linux
> repositories.
>
> The setup:
> 1. chose a query string, e.g. "is:inbox or is:spam"
> 2. chose a tag to exclude that is matched by the query, e.g. "spam"
> 3. open the database
> 4. create a query
> 5. check the message or thread count any number of times
> 6. exclude the tag from the query
> 7. check the message or thread count any number of times
>
> The result:
> - In step 5 the result stays the same if I repeatedly call
>   notmuch_query_count_messages_st or query.count_messages.
> - In step 7 the count is different between the first call and all
>   subsequent calls.  But neither seems correct to me.  I always get the
>   same number as in step 5 for the first call and 0 afterwards.

This bug should be fixed in commit  dfacfe14, which will be part of
notmuch 0.24. Thanks for your clear report and test case.

d


More information about the notmuch mailing list