Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: chrisw@rice.edu (Christopher Warrington)
Subject: [sup-talk] Maildir source with one message
Date: Mon, 03 Mar 2008 01:07:55 -0600	[thread overview]
Message-ID: <1204528063-sup-7345@chris-tablet> (raw)

In playing with offline IMAP and Maildir sources (much faster than a native IMAP source and it can be used offline!), I noticed an odd bug.

If there is only one message in a Maildir source, neither sup not
sup-sync can see this message. Adding another message makes both
visible messages visible.

--- here begins speculation ---

I *THINK* that this has to do with the definitions Source.start_offset
and Source.end_offset. As I understand it, they should define a range
of message ids [start_offset, end_offset).

Now, when start_offset = end_offset--as is the case when there is only
one message, bad things happen. As I understand the math:
(a,a) = {}
[a,a) = {} *our case
(a,a] = {}
[a,a] = {a.

Changing maildir.rb:126 from:
    @ids.last
to
    @ids.last + 1
appears to have fixed the problem without ill-effect.

Simple inspection of imap.rp leads be to believe that it will have the
same problem.

A mbox source will have the same problem iff the mbox is empty.

--- here ends speculation ---

-- 
Christopher Warrington <chrisw at rice.edu>


             reply	other threads:[~2008-03-03  7:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03  7:07 Christopher Warrington [this message]
2008-03-03  8:00 ` [sup-talk] [PATCH] fixed off-by-one error in imap.rb and maildir.rb Christopher Warrington
2008-03-26 16:04   ` William Morgan
2008-04-03 16:35     ` Grant Hollingworth
2008-04-04 17:48       ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204528063-sup-7345@chris-tablet \
    --to=chrisw@rice.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox