Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: ezyang@MIT.EDU (Edward Z. Yang)
Subject: [sup-talk] Odd bug with lazy-loaded messages
Date: Sat, 08 Aug 2009 02:07:22 -0400	[thread overview]
Message-ID: <1249711570-sup-2277@javelin> (raw)
In-Reply-To: <1249319474-sup-8322@masanjin.net>

Excerpts from William Morgan's message of Mon Aug 03 13:18:50 -0400 2009:
> This is because we store a couple variants of the address in the index
> (e.g. the email address to the left of the @), so that a search on any
> of them will bring up the message. Without #load_from_source!, the
> message is loaded from the index, so it reflects those fields. So it's
> basically a hack at this point. You could further hack it by undoing
> that transformation. Or we could add the original version of the fields
> to the index in a separate, non-searchable field, incurring the
> associated storage penalties.

Great.  I sprinkled a few extra load_from_source! calls and I think
I made the weird behavior go away.  It's kind of sketchy though.

From 6c539b9c0fb952b0cc10c121cb906b1aefd58c31 Mon Sep 17 00:00:00 2001
From: Edward Z. Yang <edwardzyang at thewritingpot.com>
Date: Mon, 8 Jun 2009 22:21:01 -0400
Subject: [PATCH 1/3] Remove message pre-loading; optimizes for the common case.

There are some load_from_source! calls to flush away extra
header info that we don't want displayed.  We may need to add
this in more/less places.

Signed-off-by: Edward Z. Yang <ezyang at mit.edu>
---
 lib/sup/modes/thread-index-mode.rb |    1 -
 lib/sup/modes/thread-view-mode.rb  |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index b671119..5e58072 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -105,7 +105,6 @@ EOS
         t.each_with_index do |(m, *o), i|
           next unless m
           BufferManager.say "#{message} (#{i}/#{num})", sid if t.size > 1
-          m.load_from_source! 
         end
       end
       mode = ThreadViewMode.new t, @hidden_labels, self
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 737f6f1..94e3ed7 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -124,6 +124,7 @@ EOS
       end
     end
 
+    latest.load_from_source!
     @layout[latest].state = :open if @layout[latest].state == :closed
     @layout[earliest].state = :detailed if earliest.has_label?(:unread) || @thread.size == 1
 
@@ -555,6 +556,7 @@ private
 
   def initial_state_for m
     if m.has_label?(:starred) || m.has_label?(:unread)
+      m.load_from_source!
       :open
     else
       :closed
-- 
1.6.3.3


  reply	other threads:[~2009-08-08  6:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27 17:36 Edward Z. Yang
2009-08-03 17:18 ` William Morgan
2009-08-08  6:07   ` Edward Z. Yang [this message]
2009-08-09  8:40     ` Edward Z. Yang
2009-12-15 22:40       ` Edward Z. Yang

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=1249711570-sup-2277@javelin \
    --to=ezyang@mit.edu \
    /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