Subject: [sup-talk] messages wrongly labeled as drafts

From: [email-masked] (jeff covey)
Date: Thu, 16 Aug 2007 21:20:33 -0400

i postponed a message, then came back to it, finished it, and sent it.  the
thread still appears with a "draft" label, which i can't remove.  there are
currently no draft messages waiting to be finished, but if i hit "R", i get
this exception:

[Thu Aug 16 21:16:01 -0400 2007] stopped cursing
[Thu Aug 16 21:16:01 -0400 2007] oh crap, an exception
[Thu Aug 16 21:16:01 -0400 2007] unlocking /home/jeff/.sup/lock...
----------------------------------------------------------------
I'm very sorry, but it seems that an error occurred in Sup.
Please accept my sincere apologies. If you don't mind, please
send the backtrace below and a brief report of the circumstances
to sup-talk at rubyforge dot orgs so that I might address this
problem. Thank you!

Sincerely,
William
----------------------------------------------------------------

The problem was: 'not a draft' (error type RuntimeError)
A backtrace follows:
./lib/sup/message.rb:156:in `draft_filename': not a draft (RuntimeError)
        from ./lib/sup/modes/resume-mode.rb:8:in `initialize'
        from bin/sup:253:in `new'
        from bin/sup:253

thanks,

-- 
jeff covey
http://jeffcovey.net/

---

From: [email-masked] (William Morgan)
Date: Sun, 19 Aug 2007 22:15:21 -0700

Excerpts from jeff.covey's message of Thu Aug 16 18:20:33 -0700 2007:
> i postponed a message, then came back to it, finished it, and sent it.
> the thread still appears with a "draft" label, which i can't remove.
> there are currently no draft messages waiting to be finished, but if i
> hit "R", i get this exception:

Hm. I'm having trouble reproducing this. Are you able to reproduce it?

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (jeff covey)
Date: Mon, 20 Aug 2007 06:04:36 -0400

> Hm. I'm having trouble reproducing this. Are you able to reproduce it?

there's definitely something odd going on with drafts.  i'm trying to work
on another draft message now.  i started writing it and postponed it.  when
i came back to it, added to it, and exited the editor, i hit "P" to postpone
it again.  the next time i tried to edit it some more, my additions from the
second editing session were gone.  i added a bit of text again as a trial,
and when i exited the editor and postponed, that addition was gone as well.
i tried once again, and this time after exiting the editor, i hit "x" to
kill the buffer.  i was asked "discard draft?", and when i hit "n", i got
the exception below.

when i restarted sup, i had three draft messages in my inbox, one for each
of my attempts (minus the one with the exception), and there are files named
"1", "2", and "3" in ~/.sup/drafts, each with a slightly different version
of the message.

[Mon Aug 20 05:51:18 -0400 2007] stopped cursing
[Mon Aug 20 05:51:18 -0400 2007] oh crap, an exception
[Mon Aug 20 05:51:18 -0400 2007] unlocking /home/jeff/.sup/lock...
----------------------------------------------------------------
I'm very sorry, but it seems that an error occurred in Sup.
Please accept my sincere apologies. If you don't mind, please
send the backtrace below and a brief report of the circumstances
to sup-talk at rubyforge dot orgs so that I might address this
problem. Thank you!

Sincerely,
William

The problem was: 'undefined method `to_nice_s' for nil:NilClass' (error type NoMethodError)
A backtrace follows:
./lib/sup/modes/thread-index-mode.rb:449:in `text_for_thread': undefined method `to_nice_s' for nil:NilClass (NoMethodError)
        from ./lib/sup/modes/thread-index-mode.rb:431:in `regen_text'
        from ./lib/sup/util.rb:233:in `map_with_index'
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `each_with_index'
        from ./lib/sup/util.rb:233:in `each'
        from ./lib/sup/util.rb:233:in `each_with_index'
        from ./lib/sup/util.rb:233:in `map_with_index'
        from ./lib/sup/modes/thread-index-mode.rb:431:in `regen_text'
        from ./lib/sup/modes/thread-index-mode.rb:137:in `update'
         ... 9 levels...
        from ./lib/sup/util.rb:387:in `method_missing'
        from ./lib/sup/modes/resume-mode.rb:25:in `killable?'
        from ./lib/sup/buffer.rb:317:in `kill_buffer_safely'
        from bin/sup:205

thanks,

-- 
jeff covey
http://jeffcovey.net/

---

From: [email-masked] (William Morgan)
Date: Mon, 20 Aug 2007 10:01:11 -0700

Excerpts from jeff.covey's message of Mon Aug 20 03:04:36 -0700 2007:
> there's definitely something odd going on with drafts.  i'm trying to
> work on another draft message now.  i started writing it and postponed
> it.  when i came back to it, added to it, and exited the editor, i hit
> "P" to postpone it again.  the next time i tried to edit it some more,
> my additions from the second editing session were gone.  i added a bit
> of text again as a trial, and when i exited the editor and postponed,
> that addition was gone as well.  i tried once again, and this time
> after exiting the editor, i hit "x" to kill the buffer.  i was asked
> "discard draft?", and when i hit "n", i got the exception below.

Bizarre. This all works for me, and has for months. Does draft saving
and resuming work for other people?

> ./lib/sup/modes/thread-index-mode.rb:449:in `text_for_thread': undefined method

Can you send me the contents of sup-exception-log.txt, which contains
the full backtrace? (The ruby stdout one elides a critical section in
this case.)

Thanks,

---

From: [email-masked] (jeff covey)
Date: Mon, 20 Aug 2007 08:28:41 -0400

Excerpts from jeff covey's message of Mon Aug 20 06:04:36 -0400 2007:

> of my attempts (minus the one with the exception), and there are files
> named "1", "2", and "3" in ~/.sup/drafts, each with a slightly different
> version of the message.

i finished and sent the message and deleted the thread with the three
messages in sup, but the three files are still in ~/.sup/drafts.

thanks,

-- 
jeff covey
http://jeffcovey.net/

---

From: [email-masked] (jeff covey)
Date: Tue, 21 Aug 2007 14:19:35 -0400

Excerpts from William Morgan's message of Mon Aug 20 13:01:11 -0400 2007:

> Can you send me the contents of sup-exception-log.txt, which contains the
> full backtrace? 

there was nothing in there about it.  the exception with the draft messages
occurred on 8/20, and this is the full contents of sup-exception-log.txt:

--- TypeError at Sat Aug 18 08:07:08 -0400 2007
wrong argument type FalseClass (expected Thread)
./lib/sup/buffer.rb:239:in `unlock'
./lib/sup/buffer.rb:239:in `draw_screen'
./lib/sup/buffer.rb:575:in `say'
./lib/sup/util.rb:401:in `send'
./lib/sup/util.rb:401:in `method_missing'
./lib/sup/modes/thread-index-mode.rb:72:in `select'
./lib/sup.rb:68:in `reporting_thread'
./lib/sup.rb:66:in `initialize'
./lib/sup.rb:66:in `new'
./lib/sup.rb:66:in `reporting_thread'
./lib/sup/modes/thread-index-mode.rb:71:in `select'
./lib/sup/mode.rb:52:in `send'
./lib/sup/mode.rb:52:in `handle_input'
./lib/sup/buffer.rb:191:in `handle_input'
bin/sup:186

thanks,

-- 
jeff covey
http://jeffcovey.net/

---

From: [email-masked] (William Morgan)
Date: Thu, 23 Aug 2007 10:40:33 -0700

> wrong argument type FalseClass (expected Thread)

Hm, this is some other unrelated completely scary backtrace. I'm going
to ignore it and pretend it never happened.

My guess at this point is that the index and your drafts directory
somehow got out of sync. Can you run "sup-sync -va sup://drafts" and see
if that clears up the problem?

Thanks for the patience,

---

From: [email-masked] (jeff covey)
Date: Thu, 23 Aug 2007 18:05:01 -0400

Excerpts from William Morgan's message of Thu Aug 23 13:40:33 -0400 2007:

> Can you run "sup-sync -va sup://drafts" and see if that clears up the
> problem?

hey, that seems to have found something:

./lib/sup/util.rb:7: warning: method redefined; discarding old gen_lock_id
./lib/sup/util.rb:18: warning: method redefined; discarding old dump_lock_id
bin/sup-sync:9: warning: method redefined; discarding old to_s
[Thu Aug 23 18:00:21 -0400 2007] locking /home/jeff/.sup/lock...
[Thu Aug 23 18:00:21 -0400 2007] loading index...
[Thu Aug 23 18:00:21 -0400 2007] loaded index of 1066 messages
Scanning sup://drafts...
Scanned 0, added 0, updated 0 messages from sup://drafts.
Deleting missing messages from the index...
Deleting 1187603448-sup-5121 at mona
Deleting 1187603421-sup-9743 at mona
Deleting 1187603324-sup-7344 at mona
Deleted 3 / 3 messages
[Thu Aug 23 18:00:21 -0400 2007] saving index and sources...
[Thu Aug 23 18:00:21 -0400 2007] unlocking /home/jeff/.sup/lock...

but postponing this message, editing it again, and postponing again still
results in two draft messages.

thanks,

-- 
jeff covey
http://jeffcovey.net/