[sup-talk] draft files aren't deleted when a draft message is deleted in the inbox

William Morgan wmorgan-sup at masanjin.net
Thu Sep 13 21:34:49 EDT 2007


Excerpts from jeff.covey's message of Wed Sep 12 20:38:39 -0700 2007:
> i postponed a message and decided later not to finish it.  it was in
> my inbox with a "draft" label.  i hit "d", and it disappeared from the
> inbox, but ~/.sup/drafts/0 is still there with its contents.

Interesting. Are there weird permissions on that directory, that would
otherwise preclude you from deleting a file?

Can you apply this diagnostic patch and post the "XX" log messages,
please?

Index: lib/sup/draft.rb
===================================================================
--- lib/sup/draft.rb    (revision 566)
+++ lib/sup/draft.rb    (working copy)
@@ -35,7 +35,19 @@
     raise ArgumentError, "can't find entry for draft: #{mid.inspect}" unless entry
     raise ArgumentError, "not a draft: source id #{entry[:source_id].inspect}, should be #{DraftManager.source_id.inspect} for #{mid.inspect} / docno #{docid}" unless entry[:source_id].to_i == DraftManager.source_id
     Index.drop_entry docid
-    File.delete @source.fn_for_offset(entry[:source_info])
+
+    fn = @source.fn_for_offset(entry[:source_info])
+    Redwood::log "XX about to delete: #{fn}"
+    rv = 
+      begin
+        File.delete fn
+      rescue Exception => e
+        Redwood::log "XX exception (e.class): #{e.message}"
+        nil
+      end
+    Redwood::log "XX deletion had return value #{rv.inspect}"
+    Redwood::log "XX file still there? #{File.exists? fn}"
+
     UpdateManager.relay self, :delete, mid
   end
 end


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


More information about the sup-talk mailing list