Subject: Re: [sup-devel] Exception when composing messages

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

Reformatted excerpts from Israel Herraiz's message of 2010-01-25:
> I am using the next branch of Sup, and since a couple of commits ago,
> whenever I try to compose a message (new, forward, etc), I obtain this
> exception:

This should be fixed!
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Israel Herraiz <[email-masked]>
Date: Mon, 25 Jan 2010 14:53:12 +0100

Hi all,

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

The problem seems to be between lines 410 and 573 of
lib/sup/xapian_index.rb

Some time ago, around line 573, there was the following line in the
file:

	when :any then PREFIX['email']

Adding that to the current version of file does not solve the problem
though. I obtain another exception telling that it cannot convert from
String to Array. 

If I change line 410 to the following (undoing my previous change), it
works again:

        participant_terms = opts[:participants].map { |p| mkterm(:email,:to, (Redwood::Person === p) ? p.email : p) }

Notice that I have just substituted :any by :to.

I have to admit that I am not really aware of what that change
implies. I have tried to find the commit that changed the behavior,
without success. But in any case I think this is a bug :-).
	
Cheers,
Israel

---

From: Israel Herraiz <[email-masked]>
Date: Mon, 25 Jan 2010 14:57:07 +0100

It seems that someone (not me :-) opened an issue about this some
minutes before my message:

 http://masanjin.net/sup-bugs/issue49

Cheers,
Israel