From 96c0ce28f8288773870bff5a6ef1c43ff3a931f8 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 24 Oct 2013 11:19:11 -0400 Subject: emacs: Fix search tagging races This fixes races in thread-local and global tagging in notmuch-search (e.g., "+", "-", "a", "*", etc.). Previously, these would modify tags of new messages that arrived after the search. Now they only operate on the messages that were in the threads when the search was performed. This prevents surprises like archiving messages that arrived in a thread after the search results were shown. This eliminates `notmuch-search-find-thread-id-region(-search)' because these functions strongly encouraged racy usage. This fixes the two broken tests added by the previous patch. --- test/emacs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'test') diff --git a/test/emacs b/test/emacs index 7503e962..3b3b14d7 100755 --- a/test/emacs +++ b/test/emacs @@ -889,7 +889,7 @@ $PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details) --- [XXX] $PWD/notmuch_fail exited with status 1 -command: $PWD/notmuch_fail search --format\=sexp --format-version\=1 --sort\=newest-first tag\:inbox +command: $PWD/notmuch_fail search --format\=sexp --format-version\=2 --sort\=newest-first tag\:inbox exit status: 1" test_begin_subtest "Search handles subprocess warnings" @@ -923,7 +923,6 @@ This is a warning This is another warning" test_begin_subtest "Search thread tag operations are race-free" -test_subtest_known_broken add_message '[subject]="Search race test"' gen_msg_id_1=$gen_msg_id generate_message '[in-reply-to]="<'$gen_msg_id_1'>"' \ @@ -937,7 +936,6 @@ output=$(notmuch search --output=messages 'tag:search-thread-race-tag') test_expect_equal "$output" "id:$gen_msg_id_1" test_begin_subtest "Search global tag operations are race-free" -test_subtest_known_broken generate_message '[in-reply-to]="<'$gen_msg_id_1'>"' \ '[references]="<'$gen_msg_id_1'>"' \ '[subject]="Re: Search race test"' -- cgit v1.2.3