pullnews - bugfix, wishlist, new features

Geraint Edwards gedge-lists-inn-workers at yadn.org
Tue May 27 10:22:26 UTC 2008


Julien ?LIE <julien at trigofacile.com> said
		(on Mon, May 26, 2008 at 08:12:52PM +0200):
> > - fixed what I may be a long-standing bug in the section with the
> > comment 'we connected OK', where we reset the high watermark
> > (now that -w exists, if the server resets article numbers, I
> > think it best we reset to the low value not the high - comments?);
> 
>     if ($prevHigh == -1 || $last < $high) {
>       # we connected OK but there's nothing there, or we just want
>       # to reset our highwater mark.
>       $shash->{$group} = [ time, $first ];
>       print LOG " (reset highwater mark to $first)\n" unless $quiet;

The code (in CVS) is currently:

    if ($prevHigh == -1 || $last <= $prevHigh) {
        # we connected OK but there's nothing there, or we just want
        # to reset our highwater mark.
        $shash->{$group} = [ time, $high ];
        print LOG " (nothing to get)\n";
        return 1 ;

But, $high == $prevHigh (our last-retrieved article number) and neither
changes (oddly redundant variable use), so setting 'high' to $high does not
change it - even when the server is lower(!).  So this code is only really
effective when $prevHigh == -1 and even that is not documented as a
meaningful/recommended/valid value, so I'm not sure when that will be the
case, either, and effectively 'no-ops' the group (because 'high' gets set
to $high which is -1 !).  Most odd.

> It depends upon what we understand with "reset":
>  * start from nought?
>  * start from now?
> But I think the first one is the right to use here.

Yes, my latest thought is to apply the principle of least surprise (aka
backwards compatibility with bugs?), and put the current bug(?) back in
and add yet another option -- e.g.
	"-b fraction" where fraction is 0.0-1.0
to backtrack (when the server is lower) to:
	- $first if <fraction> is 1,
	- $last if <fraction> is 0
	- or some fraction between

Version 'g5' now uploaded with a couple of other changes.

-- 
Geraint A. Edwards (aka "Gedge")
gedge at yadn.org


More information about the inn-workers mailing list