Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [issue49] crash when pressing 'c' to compose
@ 2010-01-25 13:41 anonymous
  2010-01-25 14:22 ` Ben Walton
  0 siblings, 1 reply; 6+ messages in thread
From: anonymous @ 2010-01-25 13:41 UTC (permalink / raw)
  To: sup-devel


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 <sup-bugs@masanjin.net>
<http://masanjin.net/sup-bugs/issue49>
_________________________________________
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] [issue49] crash when pressing 'c' to compose
  2010-01-25 13:41 [sup-devel] [issue49] crash when pressing 'c' to compose anonymous
@ 2010-01-25 14:22 ` Ben Walton
  2010-01-25 14:29   ` Ben Walton
  2010-01-25 16:03   ` [sup-devel] [PATCH] fix participants queries Rich Lane
  0 siblings, 2 replies; 6+ messages in thread
From: Ben Walton @ 2010-01-25 14:22 UTC (permalink / raw)
  To: sup-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 950 bytes --]

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

This was me...

Patch attached.

> --- 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

HTH.
-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.

[-- Attachment #1.1.2: 0001-Fix-crash-in-mkterm-when-parameter-any-is-used-with-.patch --]
[-- Type: application/octet-stream, Size: 1083 bytes --]

From c2d9caf6ffa3f6b4aad6d2bd14a44ee9140314a3 Mon Sep 17 00:00:00 2001
From: Ben Walton <bwalton@artsci.utoronto.ca>
Date: Mon, 25 Jan 2010 09:19:34 -0500
Subject: [PATCH] Fix crash in mkterm when parameter :any is used with :email

Without this patch, sup was crashing in mkterm after pressing 'c' from
index mode to compose a message.  This patch teaches mkterm how to
handle building a query consisting of both from_email to to_email.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 lib/sup/xapian_index.rb |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index 5efd47b..cb1dde7 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -570,6 +570,7 @@ EOS
       case args[0]
       when :from then PREFIX['from_email']
       when :to then PREFIX['to_email']
+      when :any then PREFIX['to_email'] + args[1].to_s.downcase + ' OR ' + PREFIX['from_email']
       else raise "Invalid email term type #{args[0]}"
       end + args[1].to_s.downcase
     when :source_id
-- 
1.6.6


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] [issue49] crash when pressing 'c' to compose
  2010-01-25 14:22 ` Ben Walton
@ 2010-01-25 14:29   ` Ben Walton
  2010-01-25 16:03   ` [sup-devel] [PATCH] fix participants queries Rich Lane
  1 sibling, 0 replies; 6+ messages in thread
From: Ben Walton @ 2010-01-25 14:29 UTC (permalink / raw)
  To: sup-devel


[-- Attachment #1.1: Type: text/plain, Size: 450 bytes --]

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.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [sup-devel] [PATCH] fix participants queries
  2010-01-25 14:22 ` Ben Walton
  2010-01-25 14:29   ` Ben Walton
@ 2010-01-25 16:03   ` Rich Lane
  2010-01-25 16:35     ` Ben Walton
  2010-01-25 21:20     ` William Morgan
  1 sibling, 2 replies; 6+ messages in thread
From: Rich Lane @ 2010-01-25 16:03 UTC (permalink / raw)
  To: sup-devel

---
 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

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] [PATCH] fix participants queries
  2010-01-25 16:03   ` [sup-devel] [PATCH] fix participants queries Rich Lane
@ 2010-01-25 16:35     ` Ben Walton
  2010-01-25 21:20     ` William Morgan
  1 sibling, 0 replies; 6+ messages in thread
From: Ben Walton @ 2010-01-25 16:35 UTC (permalink / raw)
  To: sup-devel


[-- Attachment #1.1: Type: text/plain, Size: 606 bytes --]

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

-- 
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.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [sup-devel] [PATCH] fix participants queries
  2010-01-25 16:03   ` [sup-devel] [PATCH] fix participants queries Rich Lane
  2010-01-25 16:35     ` Ben Walton
@ 2010-01-25 21:20     ` William Morgan
  1 sibling, 0 replies; 6+ messages in thread
From: William Morgan @ 2010-01-25 21:20 UTC (permalink / raw)
  To: sup-devel

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 <wmorgan-sup@masanjin.net>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-25 21:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-25 13:41 [sup-devel] [issue49] crash when pressing 'c' to compose anonymous
2010-01-25 14:22 ` Ben Walton
2010-01-25 14:29   ` Ben Walton
2010-01-25 16:03   ` [sup-devel] [PATCH] fix participants queries Rich Lane
2010-01-25 16:35     ` Ben Walton
2010-01-25 21:20     ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox