]> git.notmuchmail.org Git - notmuch/commit
notmuch new: Defer maildir_flags synchronization until after removals
authorCarl Worth <cworth@cworth.org>
Thu, 11 Nov 2010 10:49:24 +0000 (02:49 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 11 Nov 2010 11:40:19 +0000 (03:40 -0800)
commit38d82b07c4462d2b3e4bc1ad3d24586be348db1d
treec5267b81d6f6fccf9392c84277978ee76351c98a
parent5a98880add247cca406cc99bf826398915ee6039
notmuch new: Defer maildir_flags synchronization until after removals

When a file in the mailstore is renamed, this appears to "notmuch new"
as both an added file and a removed file (for the same message). We
want the synchronization of the maildir_flags to reflect the final
state, (after the rename is complete). Therefore, it's incorrect to
perform the synchronization immediately after adding a new
file. Instead we queue up these synchronizations (by message ID[*])
and perform them after the removals are complete.

With this change, the "dump/restore" case of the maildir-sync tests,
as well as the recent "remove 'S'" case both now pass where they were
failing before.

Interestingly, the "remove info" test was passing before, but now
fails. This is actually due to a separate bug, (and the bug just fixed
was masking it, by preventing the test from performing as desired).

[*] It's important to queue by message ID---queueing actual message
objects does not work since the message objects will retain stale data
such as the old filenames.
notmuch-new.c