--- /dev/null
+Return-Path: <alpine.art.de@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 90A6C6DE0FFA\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:44:10 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.319\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.319 tagged_above=-999 required=5 tests=[AWL=0.501,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,\r
+ SPF_PASS=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id offpM1yQcsfH for <notmuch@notmuchmail.org>;\r
+ Sun, 28 Feb 2016 06:44:08 -0800 (PST)\r
+Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com\r
+ [74.125.82.47]) by arlo.cworth.org (Postfix) with ESMTPS id 354B06DE0B20 for\r
+ <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:44:08 -0800 (PST)\r
+Received: by mail-wm0-f47.google.com with SMTP id n186so16537959wmn.1\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 06:44:08 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=date:from:subject:to:references:in-reply-to:user-agent:message-id\r
+ :mime-version:content-transfer-encoding;\r
+ bh=XwNp+IW7Vd4xC1LLCOORv4oX0BQ59BQnqVFefUiiUTo=;\r
+ b=0giU7M0XIILQftCPQR3ed6RRO155TGAmRNxBvJh8M+zG7+o184BQNpsTHCM608BSK3\r
+ YaC+P3gOGC5K46+ObWoJMO2FT/GiNaF9/jMr8XHBC3o6n6eDBDRtmJmpElMpZiVSv1/x\r
+ YDqlvRi/8UNyUrYfPlixGol7njGjDyBiM3jRhG5TJoK0lbjTAejgt7vduYO9c2zFen9P\r
+ BxtqXqUsvWOTiMHYCYDu9nq+bhIIKxm1yT0lzqxwdRzDZdPcOsEOl9uvqVjTgPbQzrug\r
+ TVtCGCDjmcAA1VhWdu1/5ZMaYTACA1bdxaF34GS86bij6l63RqTj2/b2rPjtjUDbp9hR\r
+ cDug==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:date:from:subject:to:references:in-reply-to\r
+ :user-agent:message-id:mime-version:content-transfer-encoding;\r
+ bh=XwNp+IW7Vd4xC1LLCOORv4oX0BQ59BQnqVFefUiiUTo=;\r
+ b=Qbz8bewjBLxWtsrDY6NHvQgZYLsv1hIE7ws+nOsnRMX+asCbNpegDfSPOtwlp41Tjm\r
+ LqRvWGB5JW3saI3W6UccGXsz8d8qMb17b6vSNnDYvS6TG8RHcgfguLffTB5A1HgFFOYx\r
+ QYuwCEJ3OfySyh7QH95h5ZguE8OnaItBRatNoPpQs6SvB4eNkcUK543LcRTB17b3ZrSL\r
+ lFz1Ng3yamlNEQ/jYEHLqIlUCVwZbw1VRMsDBG6XJzNCx7uN9nf7hV2w2QXa5p84GK5+\r
+ rUIDqnOrwEnnLtyXemxfK4iCEjGt/QIJ1zZqCjwJ+tk9hUvyzfnUJqQBoy+UBtVZ/tDy\r
+ MThg==\r
+X-Gm-Message-State:\r
+ AD7BkJIc5gqe2cr2tEyIVXtrm5I1IgSnmsWbItyzcjA9pHS4B7NysSq2HDBxssmzSgoSgQ==\r
+X-Received: by 10.194.95.40 with SMTP id dh8mr11754928wjb.146.1456670646839;\r
+ Sun, 28 Feb 2016 06:44:06 -0800 (PST)\r
+Received: from localhost (p579BA378.dip0.t-ipconnect.de. [87.155.163.120])\r
+ by smtp.gmail.com with ESMTPSA id k8sm21448021wjr.38.2016.02.28.06.44.05\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 28 Feb 2016 06:44:05 -0800 (PST)\r
+Date: Sun, 28 Feb 2016 14:46:07 +0000\r
+From: Franz Fellner <alpine.art.de@gmail.com>\r
+Subject: Re: need to call notmuch_threads_get (..) to actually move iterator\r
+To: Gaute Hope <eg@gaute.vetsj.com>, notmuch@notmuchmail.org\r
+References: <1456315381-astroid-1-8aih8mdal8-11676@strange>\r
+ <1456669181-astroid-0-hsim583msj-27330@TP_L520>\r
+In-Reply-To: <1456669181-astroid-0-hsim583msj-27330@TP_L520>\r
+User-Agent: astroid/v0.5-61-gab5b649c (https://github.com/gauteh/astroid)\r
+Message-Id: <1456670385-astroid-0-hgj454pqy2-29417@TP_L520>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8; format=flowed\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 28 Feb 2016 14:44:10 -0000\r
+\r
+Really might be the issue: Threads with many messages duplicate more\r
+often than messages with few messages. Threads with only one message\r
+never seem to come up more than twice.\r
+Currently I don't have the time to track down what actually get's stored\r
+in match_set, would be nice if a dev could shed some light on it. Thx!\r
+\r
+Excerpts from Franz Fellner's message of Februar 28, 2016 3:26 :\r
+> It might be I found the issue:\r
+> One big thing notmuch_threads_get does is remove the thread_id from the\r
+> match_set. Playing with astroid (branch ti-skip-and-load) i see that it\r
+> is not entirely true that the iterator doesn't move. It just seems to\r
+> duplicate some messages. There definitely are coming new messages.\r
+> So my explanation is that match_set contains duplicate thread_ids. If\r
+> that is true a solution to Gautes problem might be to deduplicate the\r
+> match_set.\r
+>=20\r
+> Excerpts from Gaute Hope's message of Februar 24, 2016 1:08 :\r
+>> Hi,\r
+>>=20\r
+>> it seems to be necessary to actually call notmuch_threads_get (threads)\r
+>> to move the thread iterator from a query object, just calling\r
+>> notmuch_threads_move_to_next (..) is not enough:\r
+>>=20\r
+>> ```\r
+>>=20\r
+>> notmuch_query_t *query;\r
+>> notmuch_threads_t *threads;\r
+>> notmuch_thread_t *thread;\r
+>>=20\r
+>> query =3D notmuch_query_create (database, query_string);\r
+>> threads =3D notmuch_query_search_threads (query);\r
+>>=20\r
+>> int i =3D 0;\r
+>>=20\r
+>> for (;\r
+>> notmuch_threads_valid (threads);\r
+>> notmuch_threads_move_to_next (threads))\r
+>> {\r
+>> /*\r
+>> * with this line commented out the iterator seems to remain in\r
+>> * place, and if I below do another loop it will start from the\r
+>> * beginning.\r
+>>=20\r
+>> thread =3D notmuch_threads_get (threads);\r
+>> ....\r
+>> notmuch_thread_destroy (thread);\r
+>> */\r
+>>=20\r
+>> i++;\r
+>> if (i > 100) break;\r
+>> }\r
+>>=20\r
+>> for (;\r
+>> notmuch_threads_valid (threads);\r
+>> notmuch_threads_move_to_next (threads))\r
+>> {\r
+>> /* the thread acquired here will be the first thread in the query.\r
+>> * it should be the 101th. */\r
+>>=20\r
+>> thread =3D notmuch_threads_get (threads);\r
+>> ....\r
+>> notmuch_thread_destroy (thread);\r
+>>=20\r
+>> }\r
+>>=20\r
+>>=20\r
+>> notmuch_query_destroy (query);\r
+>> ```\r
+>>=20\r
+>> It is quite slow to skip the threads in this way, might it be faster if\r
+>> move_to_next works correctly?\r
+>>=20\r
+>> Regards, Gaute\r
+>>=20\r
+>> _______________________________________________\r
+>> notmuch mailing list\r
+>> notmuch@notmuchmail.org\r
+>> https://notmuchmail.org/mailman/listinfo/notmuch\r
+>>=20\r
+>=20\r
+=\r