* [sup-talk] Odd bug with lazy-loaded messages
@ 2009-07-27 17:36 Edward Z. Yang
2009-08-03 17:18 ` William Morgan
0 siblings, 1 reply; 5+ messages in thread
From: Edward Z. Yang @ 2009-07-27 17:36 UTC (permalink / raw)
I've been experiencing an odd bug with the following patch
for lazy loading messages:
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -103,7 +103,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
Specifically, the "default" opened message when I open a thread
gets a weird misrendering of the headers that looks like:
To: foo
foo <foo at example.com>
foo
And so forth, for all lines in To and Cc.
Any ideas what could be causing this? I checked load_from_source! in message.rb
but didn't see anything obvious that would prevent this behavior.
Cheers,
Edward
^ permalink raw reply [flat|nested] 5+ messages in thread
* [sup-talk] Odd bug with lazy-loaded messages
2009-07-27 17:36 [sup-talk] Odd bug with lazy-loaded messages Edward Z. Yang
@ 2009-08-03 17:18 ` William Morgan
2009-08-08 6:07 ` Edward Z. Yang
0 siblings, 1 reply; 5+ messages in thread
From: William Morgan @ 2009-08-03 17:18 UTC (permalink / raw)
Sorry I didn't respond to this earlier.
Reformatted excerpts from Edward Z. Yang's message of 2009-07-27:
> Specifically, the "default" opened message when I open a thread
> gets a weird misrendering of the headers that looks like:
>
> To: foo
> foo <foo at example.com>
> foo
>
> And so forth, for all lines in To and Cc.
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.
--
William <wmorgan-sup at masanjin.net>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [sup-talk] Odd bug with lazy-loaded messages
2009-08-03 17:18 ` William Morgan
@ 2009-08-08 6:07 ` Edward Z. Yang
2009-08-09 8:40 ` Edward Z. Yang
0 siblings, 1 reply; 5+ messages in thread
From: Edward Z. Yang @ 2009-08-08 6:07 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [sup-talk] Odd bug with lazy-loaded messages
2009-08-08 6:07 ` Edward Z. Yang
@ 2009-08-09 8:40 ` Edward Z. Yang
2009-12-15 22:40 ` Edward Z. Yang
0 siblings, 1 reply; 5+ messages in thread
From: Edward Z. Yang @ 2009-08-09 8:40 UTC (permalink / raw)
Excerpts from Edward Z. Yang's message of Sat Aug 08 02:07:22 -0400 2009:
> 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.
It looks like it's still a problem in some sporadic cases. Going to
submit a more thorough patch soon.
Cheers,
Edward
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [sup-talk] Odd bug with lazy-loaded messages
2009-08-09 8:40 ` Edward Z. Yang
@ 2009-12-15 22:40 ` Edward Z. Yang
0 siblings, 0 replies; 5+ messages in thread
From: Edward Z. Yang @ 2009-12-15 22:40 UTC (permalink / raw)
To: sup-talk
Excerpts from Edward Z. Yang's message of Sun Aug 09 04:40:33 -0400 2009:
> It looks like it's still a problem in some sporadic cases. Going to
> submit a more thorough patch soon.
For the record, I've switched to OfflineIMAP and am not looking back,
so consider this patchset orphaned.
Edward
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-15 22:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27 17:36 [sup-talk] Odd bug with lazy-loaded messages Edward Z. Yang
2009-08-03 17:18 ` William Morgan
2009-08-08 6:07 ` Edward Z. Yang
2009-08-09 8:40 ` Edward Z. Yang
2009-12-15 22:40 ` Edward Z. Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox