Subject: Re: [sup-devel] [issue49] crash when pressing 'c' to compose

From: Ben Walton <[email-masked]>
Date: Mon, 25 Jan 2010 09:29:05 -0500

Excerpts from Ben Walton's message of Mon Jan 25 09:22:49 -0500 2010:

> Patch attached.

BTW, the xapian index version bump (v1 -> v2) meant I couldn't
(easily) bisect this problem.  Luckily it wasn't too tough to track
down from the back trace.

-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Ben Walton <[email-masked]>
Date: Mon, 25 Jan 2010 11:35:54 -0500

Excerpts from Rich Lane's message of Mon Jan 25 11:03:35 -0500 2010:

> -      participant_terms = opts[:participants].map { |p| mkterm(:email,:any, (Redwood::Person === p) ? p.email : p) }
> +      participant_terms = opts[:participants].map { |p| [:from,:to].map { |d| mkterm(:email, d, (Redwood::Person === p) ? p.email : p) } }.flatten

Cleaner than mine.  +1 for prompt inclusion at gitorious. :)

-Ben

---

From: William Morgan <[email-masked]>
Date: Mon, 25 Jan 2010 16:20:00 -0500

Reformatted excerpts from Rich Lane's message of 2010-01-25:
>  lib/sup/xapian_index.rb |    2 +-

Applied to branch xapian-updates and remerged into next. Thanks!
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: anonymous <[email-masked]>
Date: Mon, 25 Jan 2010 13:41:29 +0000

New submission from anonymous:

--- RuntimeError from thread: main
Invalid email term type any
./sup/xapian_index.rb:573:in `mkterm'
./sup/xapian_index.rb:410:in `build_xapian_query'
./sup/xapian_index.rb:410:in `map'
./sup/xapian_index.rb:410:in `build_xapian_query'
./sup/xapian_index.rb:114:in `each_id'
./sup/xapian_index.rb:124:in `each_id_by_date'
./sup/xapian_index.rb:155:in `load_contacts'
./sup/index.rb:236:in `send'
./sup/index.rb:236:in `method_missing'
./sup/buffer.rb:543:in `ask_for_contacts'
./sup/util.rb:553:in `send'
./sup/util.rb:553:in `method_missing'
./sup/modes/compose-mode.rb:24:in `spawn_nicely'
../bin/sup:327

----------
messages: 118
nosy: anonymous
priority: bug
ruby_version: 1.8.5
status: unread
sup_version: next/a3c2f5a0a
title: crash when pressing 'c' to compose

_________________________________________
Sup issue tracker <[email-masked]>
<http://masanjin.net/sup-bugs/issue49>
_________________________________________
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Rich Lane <[email-masked]>
Date: Mon, 25 Jan 2010 08:03:35 -0800

---
 lib/sup/xapian_index.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index 5efd47b..443b88d 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -407,7 +407,7 @@ EOS
     pos_terms << mkterm(:source_id, opts[:source_id]) if opts[:source_id]
 
     if opts[:participants]
-      participant_terms = opts[:participants].map { |p| mkterm(:email,:any, (Redwood::Person === p) ? p.email : p) }
+      participant_terms = opts[:participants].map { |p| [:from,:to].map { |d| mkterm(:email, d, (Redwood::Person === p) ? p.email : p) } }.flatten
       pos_terms << Q.new(Q::OP_OR, participant_terms)
     end
 
-- 
1.6.3.3

---

From: Ben Walton <[email-masked]>
Date: Mon, 25 Jan 2010 09:22:49 -0500

Excerpts from anonymous's message of Mon Jan 25 08:41:29 -0500 2010:

This was me...

Patch attached.

> ./sup/modes/compose-mode.rb:24:in `spawn_nicely'

HTH.
-Ben