Subject: [sup-talk] Inconsistent inbox after restart

From: [email-masked] (Steve Goldman)
Date: Tue, 28 Apr 2009 15:19:26 -0400

This only started happening after I upgraded to the latest version...

Oftentimes when I quit sup and then restart, my inbox looks different.
Messages that I had previously archived are back in the inbox.  Has
anyone else seen this?  I'm losing sleep over it.

Thanks.
-- 

Steve Goldman
sgoldman at tower-research.com

T: 212.219.6014
F: 212.219.6007

Tower Research Capital, LLC
377 Broadway, 11th Fl.
New York, NY 10013

---

From: [email-masked] (Nicolas Pouillard)
Date: Wed, 29 Apr 2009 10:40:13 +0200

> anyone else seen this?  I'm losing sleep over it.

 From time to time I also encounter this issue: previously archived emails
 come back to the inbox.

-- 
Nicolas Pouillard

---

From: [email-masked] (Tyberius Prime)
Date: Wed, 29 Apr 2009 10:37:08 +0200

I should add, the read status is being kept for me.

---

From: [email-masked] (Tyberius Prime)
Date: Wed, 29 Apr 2009 10:17:23 +0200

Hi,

yes, I see the same, 
haven't dug into it so far either, simply never restart sup
if I can avoid it... (yeah, great conflict strategy, but
life's short).

So long,
Tyberius Prime

---

From: [email-masked] (William Morgan)
Date: Wed, 29 Apr 2009 11:10:53 -0700

> anyone else seen this?  I'm losing sleep over it.

I see it periodically too (I think I also see read messages turned
unread again) and have been trying to find a pattern---is it email
that's autosaved when I quit Sup, etc.?
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Tyberius Prime)
Date: Thu, 30 Apr 2009 09:11:29 +0200

For me it seems to be messages that have been saved 'hours' ago by pressing $.

---

From: [email-masked] (Steve Goldman)
Date: Thu, 30 Apr 2009 08:51:42 -0400

> > that's autosaved when I quit Sup, etc.?

I have confirmed that 0.7 is fine, but master is not.  So we just have
to track down which commit(s) in between broke it...
-- 

Steve Goldman

T: 212.219.6014
F: 212.219.6007

---

From: [email-masked] (Ben Walton)
Date: Thu, 30 Apr 2009 09:10:20 -0400

On Thu, Apr 30, 2009 at 8:51 AM, Steve Goldman
<sgoldman at tower-research.com> wrote:
> I have confirmed that 0.7 is fine, but master is not. ?So we just have

git-bisect to the rescue?  Anyone experiencing this and comfortable
with git that wants to track down where the problem was introduced?
It may take a little while, unless the problem can be recreated at
will, but the bisect tool is awesome for situations like this.

-Ben

-- 
---------------------------------------------------------------------------------------------------------------------------
Ben Walton <bdwalton at gmail.com>

"With or without religion, good people can behave well and bad people
can do evil; but for good people to do evil?that takes religion. "
-Steven Weinberg
---------------------------------------------------------------------------------------------------------------------------

---

From: [email-masked] (William Morgan)
Date: Thu, 30 Apr 2009 06:19:20 -0700

> to track down which commit(s) in between broke it...

Ok, now we're onto something! As an educated guess, I've published a
branch revert-background-save, which is identical to master except that
the commits on the background-save branch have been reverted. Can you
try that branch please?
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (William Morgan)
Date: Thu, 30 Apr 2009 06:36:22 -0700

> will, but the bisect tool is awesome for situations like this.

If the educated guesses fall through, then we'll punish Steve for his
insulin by making him binary search through all commits since 0.7.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Steve Goldman)
Date: Thu, 30 Apr 2009 10:23:25 -0400

> insulin by making him binary search through all commits since 0.7.

Bad news.  This new branch is also buggy.

Time to apply the force of brute.
-- 

Steve Goldman

T: 212.219.6014
F: 212.219.6007

---

From: [email-masked] (Steve Goldman)
Date: Fri, 01 May 2009 16:23:53 -0400

I have found the offensive commit...

Whoever was working on this, can you take a look and figure out where
the bug is?

(And for all you perl bashers out there, given this ridiculous line
of ruby, you officially can't talk any more shit.)

063ec996a24b13b5dc9a59e21aa42ba629ab510a

--- a/lib/sup/poll.rb
+++ b/lib/sup/poll.rb
@@ -97,7 +97,7 @@ EOS
         numi = 0
         add_messages_from source do |m, offset, entry|
           ## always preserve the labels on disk.
-          m.labels = entry[:label].split(/\s+/).map { |x| x.intern } if entry
+          m.labels = ((m.labels - [:unread, :inbox]) + entry[:label].split(/\s+/).map { |x| x.intern }).uniq if entry
           yield "Found message at #{offset} with labels {#{m.labels * ', '}}"
           unless entry
             num += 1
-- 

Steve Goldman

T: 212.219.6014
F: 212.219.6007

---

From: [email-masked] (William Morgan)
Date: Mon, 04 May 2009 06:32:04 -0700

> I have found the offensive commit...

Interesting. I think I see the problem. Were all the messages that
magically reappeared in your inbox messages that were sent to mailing
lists, or otherwise messages that somehow appeared twice in your inbox?

> of ruby, you officially can't talk any more shit.)

No one here has bashed Perl. Personally I prefer bashing Python (when
I'm not too busy bashing Java (when I'm not too busy bashing C++)), and
credit Perl for much of what I like about Ruby.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Steve Goldman)
Date: Mon, 04 May 2009 09:46:35 -0400

> lists, or otherwise messages that somehow appeared twice in your inbox?

Most of the messages I archive come from lists, so this is possible.
The lists I'm on are smart enough to not deliver messages twice, most
of the time.

> credit Perl for much of what I like about Ruby.

Live and let live!!
-- 

Steve Goldman

T: 212.219.6014
F: 212.219.6007