unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Carl Worth <cworth@cworth.org>
To: Austin Clements <amdragon@mit.edu>, Michal Sojka <sojkam1@fel.cvut.cz>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 1/3] new: Do not defer maildir flag synchronization during the first run
Date: Wed, 26 Jan 2011 19:15:21 +1000	[thread overview]
Message-ID: <87pqrk10wm.fsf@yoom.home.cworth.org> (raw)
In-Reply-To: <AANLkTinsC+89yx7jGUaB8PLiftLjyTr7gosUDgAC_g0S@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]

On Tue, 25 Jan 2011 17:42:30 -0500, Austin Clements <amdragon@mit.edu> wrote:
> Wouldn't this be simpler and more general?
...
>         case NOTMUCH_STATUS_SUCCESS:
..
>             if (state->synchronize_flags == TRUE)
> -               _filename_list_add (state->message_ids_to_sync,
> -                                   notmuch_message_get_message_id (message));
> +               notmuch_message_maildir_flags_to_tags (message);

Yes, that is much simpler and should work equally well as the original
patch.

But there's perhaps a problem with both of these patches. Besides
rename, (which obviously can't happen with a new message), we also need
to take care when a message is added with multiple filenames (and with
different flags on the files).

We've got a plan for adding flags-to-tags mappings which only apply if
every file for the message has the corresponding flag. For example, this
is the semantic we want for the 'D' flag mapping to the "deleted" tag.

So we'll want to make sure these cases do the right thing. Consider two
new files with the same Message-Id both appearing in a run of "notmuch
new", one with the D flag and one without.

If the file with the D flag is seen first, and the maildir_flags_to_tags
processing happens without being deferred, then the "deleted" tag will
be applied to the message. This is different than would happen if both
messages were seen, but I think it's just fine. It's still in a state
that's consistent, nothing bad would happen if you interrupted this and
then acted on the "deleted" tag, and if you restarted "notmuch new" and
the second message were seen, then the tag would be correctly removed.

So, I think I've convinced myself that the change is actually OK. But
then I'm also wondering if perhaps we could do the processing undeferred
in all cases?

I haven't thought that through, but I'd be glad to hear your ideas.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2011-01-26  9:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21  9:59 [PATCH 0/3] Speedups and enhancements of notmuch new Michal Sojka
2011-01-21  9:59 ` [PATCH 1/3] Do not defer maildir flag synchronization during the first " Michal Sojka
2011-01-21  9:59 ` [PATCH 1/3] new: Do not defer maildir flag synchronization during the first run Michal Sojka
2011-01-25 22:42   ` Austin Clements
2011-01-26  9:15     ` Carl Worth [this message]
2011-01-26 11:59       ` Carl Worth
2011-01-26 15:07         ` Austin Clements
2011-01-26 16:50           ` Michal Sojka
2011-01-27  5:04           ` Carl Worth
2011-01-27  5:43             ` Austin Clements
2011-01-30  0:21               ` Rob Browning
2011-01-21  9:59 ` [PATCH 2/3] new: Add all initial tags at once Michal Sojka
2011-01-26 12:10   ` Carl Worth
2011-01-26 16:52   ` Thomas Schwinge
2011-01-27  5:03     ` Carl Worth
2011-01-27  7:14       ` Carl Worth
2011-01-27 11:08         ` Michal Sojka
2011-01-21  9:59 ` [PATCH 3/3] new: Enhance progress reporting Michal Sojka
2011-01-26 12:23   ` Carl Worth
2011-01-26 13:16     ` Michal Sojka
2011-01-26 13:06   ` [PATCH] new: Print progress estimates only when we have sufficient information Michal Sojka
2011-01-26 13:49     ` Carl Worth
  -- strict thread matches above, loose matches on Subject: below --
2011-01-28  0:08 [PATCH 1/3] new: Do not defer maildir flag synchronization during the first run Austin Clements
2011-01-28  8:51 ` Sebastian Spaeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqrk10wm.fsf@yoom.home.cworth.org \
    --to=cworth@cworth.org \
    --cc=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=sojkam1@fel.cvut.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).