From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4GmIAM0ccWJhSAEAbAwnHQ (envelope-from ) for ; Tue, 03 May 2022 14:15:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id Fx6BAM0ccWLJYgAAauVa8A (envelope-from ) for ; Tue, 03 May 2022 14:15:09 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4A76F940E for ; Tue, 3 May 2022 14:15:08 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E08FF5F720; Tue, 3 May 2022 12:15:04 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id CF5355F70B for ; Tue, 3 May 2022 12:15:01 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 79B635FBD7; Tue, 3 May 2022 08:15:00 -0400 (EDT) Received: (nullmailer pid 2876033 invoked by uid 1000); Tue, 03 May 2022 12:14:59 -0000 From: David Bremner To: Sean Whitton , notmuch@notmuchmail.org Subject: Re: Forcing a sync of maildir flags? In-Reply-To: <87wnf334d9.fsf@melete.silentflame.com> References: <871rqp97o0.fsf@iris.silentflame.com> <87r1ypsb1p.fsf@tethera.net> <87r1yp6joi.fsf@iris.silentflame.com> <87mu9cg5xy.fsf@tethera.net> <87d0a7zpfd.fsf@iris.silentflame.com> <87ee1c7s7s.fsf@tethera.net> <87wnf334d9.fsf@melete.silentflame.com> Date: Tue, 03 May 2022 09:14:59 -0300 Message-ID: <87zgjy4xto.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 2TJLGBBLLWIBZVEZFPR3PBOZLSK5A2XJ X-Message-ID-Hash: 2TJLGBBLLWIBZVEZFPR3PBOZLSK5A2XJ X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651580108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=pb5mHW/M9FMWhID8Iu/Zib8RYRSvXOCQb6lEP4zy/qA=; b=FSLln3rhYzat2DmrxmmpQemxGalb64Q0TFJENwMD5dWZs7T8o+Gu7p0mTqD3G29ebexlB6 8QPcMbi/onU85WQS0/aZliWQHeJB20z+sC/u+ne1Hcz0Ls7YyBlr85nbhuPJReRtqo2rCh k4KwimOY1cFqsDD4p89T+kPDUXvcnOxKeooN2h/+l+wnx1hLJp214HPubpqUTH3N5ZRVX1 ZxaAFJ5H0NdjmKLTKWZyD1dXnHLVV2NnmOPwBGsMl5qhbMmZjniI285FCVbe7VJoPO6RKn GiVdSi07EU3bSt482WcyCpZZ483uQeoHljCiEl6fG5BOpknCL1dVaxshj4pFiQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651580108; a=rsa-sha256; cv=none; b=gBzsCszi6FUCAsreOlMkUGtIAlg8VIgZU4jxJNWX5TD9PK66WxQlwzWakZvCAYvhlAQ3n2 TdcGzV1RjYAT990c8v+CLXc0Hr66sKq9Aslp8KFvlGvrRBTvQ9JjdXbxc9mkMCA4bC+1Lz zxhHSGYxwg/3jBJwx473gW4Sm/5HtdlzgBUa/fUOXRps/01HOgappjR5aYomRJN4EsRiW/ uMCWWmHbg7jILqZaYYPL1nSX4mRwS4Ds5hG5yu49SWQpw/pDA2zAq2Tt0wZFLxfKRP0l3Q IIIYb+qnkcjYFsG/vkSlu2R1Zbck6IlnpD3r+eaI429ZmjNGTJcI+SWp0fkbfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.04 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 4A76F940E X-Spam-Score: -1.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: XHbGHB96bq3i Sean Whitton writes: > Hello David, >> # next line is a no-op, because it already doesn't have the unread tag >> notmuch tag -unread folder:sent > > Seems also worth noting that to my mind it ultimately shouldn't be > necessary to run that command -- notmuch should notice that one copy of > the message has different maildir flags to the other in a way that's out > of sync with the notmuch tags it has. > Right, that's probably a useful way to think about the problem. >> The key point is that from notmuch's point of view the message never has >> the unread tag, so there is no change for "notmuch tag" to sync with >> maildir flags. >> >> It doesn't seem to make a difference if I put the copy in inbox/new or >> inbox/cur, so I don't think it is related to the previous efforts not to >> prematurely move files out of new/. >> >> As far as I can tell, notmuch-new (unlike notmuch-insert) does not call >> notmuch_message_tags_to_maildir_flags, so the maildir flags on the newly >> discovered copy are not updated. Perhaps it should, but that seems like >> a pretty big change, so I want to proceed with caution. > > It makes sense to me for notmuch-new to call that function too, fwiw. I have the same intuition. Unfortunately it is not as simple as adding in a couple calls to this function. The complications I am aware of so far are 1) We need to distinguish between when a newly discovered file should update tags, and when the newly discovered file should have it's flags updated. 2) Renaming files in the middle of notmuch new needs to be done carefully in order that notmuch doesn't lose track of the files. They are only lost until the next run of notmuch-new, but it's not ideal. d