Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
From: "Edward Z. Yang" <ezyang@MIT.EDU>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>,
	sup-devel <sup-devel@rubyforge.org>
Subject: Re: [sup-devel] [PATCH] Inotify support for Maildirs. (FIRST DRAFT)
Date: Mon, 03 Sep 2012 14:09:57 -0400	[thread overview]
Message-ID: <1346695742-sup-7650@javelin> (raw)
In-Reply-To: <20120903121013.8cpe3jr5wg0kw88k@webmail.mit.edu>

OK, cracked a fix; you need this extra patch:

commit f9ea07f3c4982ab46d8171fdba8eabc3af00c840
Author: Edward Z. Yang <ezyang@mit.edu>
Date:   Mon Sep 3 14:09:34 2012 -0400

    sync_back after writing to index, not before.
    
    Signed-off-by: Edward Z. Yang <ezyang@mit.edu>

diff --git a/lib/sup/index.rb b/lib/sup/index.rb
index 13798d6..4b533a7 100644
--- a/lib/sup/index.rb
+++ b/lib/sup/index.rb
@@ -657,10 +657,6 @@ EOS
   end
 
   def sync_message m, overwrite
-    ## TODO: we should not save the message if the sync_back failed
-    ## since it would overwrite the location field
-    m.sync_back
-
     doc = synchronize { find_doc(m.id) }
     existed = doc != nil
     doc ||= Xapian::Document.new
@@ -703,6 +699,10 @@ EOS
       @xapian.replace_document docid, doc
     end
 
+    # sync_back must be after label update, so that inotify gets
+    # fresh data from the index
+    m.sync_back
+
     m.labels.each { |l| LabelManager << l }
     true
   end
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


  reply	other threads:[~2012-09-03 18:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 15:17 [sup-devel] inotify support for Maildir mailboxes Edward Z. Yang
2012-08-21 16:00 ` Alvaro Herrera
2012-09-03  4:59   ` [sup-devel] [PATCH] Inotify support for Maildirs. (FIRST DRAFT) Edward Z. Yang
2012-09-03  5:00     ` Edward Z. Yang
2012-09-03 16:02       ` Alvaro Herrera
2012-09-03 16:07         ` Alvaro Herrera
2012-09-03 16:10           ` ezyang
2012-09-03 18:09             ` Edward Z. Yang [this message]
2012-09-03 18:29               ` Edward Z. Yang
2012-09-03 18:42                 ` Alvaro Herrera
2012-09-03 18:49                   ` Edward Z. Yang
2012-09-03 19:27                   ` Edward Z. Yang
2012-09-03 23:31               ` Edward Z. Yang
2012-09-04 16:06                 ` Edward Z. Yang
2012-09-04 18:09                   ` Alvaro Herrera

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

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

  git send-email \
    --in-reply-to=1346695742-sup-7650@javelin \
    --to=ezyang@mit.edu \
    --cc=alvherre@alvh.no-ip.org \
    --cc=sup-devel@rubyforge.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox