From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.90.117.16 with SMTP id p16cs613905agc; Thu, 15 Oct 2009 07:02:07 -0700 (PDT) Received: by 10.224.78.227 with SMTP id m35mr56781qak.178.1255615326528; Thu, 15 Oct 2009 07:02:06 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 38si239691qyk.17.2009.10.15.07.02.06; Thu, 15 Oct 2009 07:02:06 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 2F1371218269; Thu, 15 Oct 2009 10:02:06 -0400 (EDT) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by rubyforge.org (Postfix) with ESMTP id E1E44197827D for ; Thu, 15 Oct 2009 09:47:09 -0400 (EDT) Received: by ey-out-2122.google.com with SMTP id 9so197331eyd.29 for ; Thu, 15 Oct 2009 06:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:content-type:subject :from:to:in-reply-to:references:date:message-id:user-agent :content-transfer-encoding; bh=tyopFGz4W6isidpZGw2WzOH9N9CGe4zOBTEDY9Pgq2k=; b=Z9BsJP9FooSVf/9uBLYPj/epJa5iGCc0iYewu2bd83s7hQVSjatI+fbpbULxO0SLEL vGecBUccruTQJbWO0chEyHzYS+OQ7eqZ0vIEBWcZcRF7a/stNlSJ45+2XXm1gESwlbeO JaItoexdVpPChYkqWnKmuBz/uxsHNwuNUYW1c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:content-type:subject:from:to:in-reply-to:references:date :message-id:user-agent:content-transfer-encoding; b=SWjx585LLUuuHgAe6xsHcAOhfOYZ0MbpyC2HcGtfeSCPbvUZmOxXT46HUV4MvhXWEe DFaLuekZlUKbTTZ8SecWviymfRPNquPypeAs77ETuOamOxvOzn1vsAuYFc8jVp8e88ZE irhov4AYfTsRyGVjrYtQ1nMUWlLjlvlrQ6OT4= Received: by 10.211.139.17 with SMTP id r17mr58372ebn.88.1255614429275; Thu, 15 Oct 2009 06:47:09 -0700 (PDT) Received: from localhost ([84.78.177.87]) by mx.google.com with ESMTPS id 7sm2422992eyg.3.2009.10.15.06.47.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 06:47:08 -0700 (PDT) From: Guillaume Quintard To: sup-talk In-reply-to: <1255610731-sup-7030@masanjin.net> References: <1254844050-sup-4148@ben-laptop> <1254844166-sup-1028@ben-laptop> <1254845543-sup-9458@ben-laptop> <1254896214-sup-5969@zyrg.net> <1e5fdab70910070148s31a8a371u81182a13e72bea4c@mail.gmail.com> <1254945119-sup-3401@ben-laptop> <1254955351-sup-5944@ben-laptop> <1255610731-sup-7030@masanjin.net> Date: Thu, 15 Oct 2009 15:47:00 +0200 Message-Id: <1255614287-sup-4683@altis> User-Agent: Sup/git Subject: Re: [sup-talk] Crash while in thread-view-mode X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Excerpts from William Morgan's message of Thu Oct 15 14:46:51 +0200 2009: > Reformatted excerpts from Ben Gamari's message of 2009-10-07: > > There must be a better way to deal with these invalid ids than > > crashing. Is there any reason this needs to be a show-stopping event? > > This is probably a symptom of some thread protection issues. You're > right, there's no reason this needs to crash Sup. You could apply this: > > diff --git a/lib/sup/modes/thread-index-mode.rb > b/lib/sup/modes/thread-index-mode.rb > index 82f258b..17d5836 100644 > --- a/lib/sup/modes/thread-index-mode.rb > +++ b/lib/sup/modes/thread-index-mode.rb > @@ -222,7 +222,7 @@ EOS > def update > @mutex.synchronize do > ## let's see you do THIS in python > - @threads = @ts.threads.select { |t| !@hidden_threads[t] }.sort_by { |t| > [t.date, t.first.id] }.reverse > + @threads = @ts.threads.select { |t| !@hidden_threads[t] }.select { |t| > t.first }.sort_by { |t| [t.date, t.first.id] }.reverse > @size_widgets = @threads.map { |t| size_widget_for_thread t } > @size_widget_width = @size_widgets.max_of { |w| w.display_length } > end Man, I love you, I can finally use sup again. (and I love the Python comment, even if I have no effing idea of what the code could mean.) Thanks! -- Guillaume _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk