From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 2E28D6DE18D9 for ; Sun, 5 Mar 2017 03:41:25 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FTkz_-dd5hT1 for ; Sun, 5 Mar 2017 03:41:24 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id E14DD6DE18D1 for ; Sun, 5 Mar 2017 03:41:23 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1ckUWn-0003Zf-Ao; Sun, 05 Mar 2017 06:40:41 -0500 Received: (nullmailer pid 3620 invoked by uid 1000); Sun, 05 Mar 2017 11:41:19 -0000 From: David Bremner To: Lucas , notmuch@notmuchmail.org Subject: Re: Bug: counting messages twice after excluding tags yields different results In-Reply-To: <147263183913.27784.12274024193186585889@mbp> References: <147263183913.27784.12274024193186585889@mbp> Date: Sun, 05 Mar 2017 07:41:19 -0400 Message-ID: <87mvd07xy8.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2017 11:41:25 -0000 Lucas 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