Open busticated opened 8 years ago
poking around a bit more, i'm reminded of how loose the rss spec really is. in particular, it seems the order of the <channel>
elements is not specified and as such you can't really be sure you won't receive <item>
s first. making matters worse, <item>
s themselves can be in any order.
the up-shot seems to be that attempting to retrieve a subset of the feed without buffering the whole thing gets weird quick (meta might be incomplete, no guarantee you'll get the N latest <item>
s)
so, yeah, fwiw.
hey there - thanks for putting together this lib. i was giving it a try and noticed something odd: the
itemLimit
option doesn't appear to do anything. i put together a quick PR w/ a failing test here --> https://github.com/djett41/node-feedjett/pull/3poking at the code, i noticed a couple of things:
.isLimitReached()
(here) will returntrue
exactly once. so callers basically never bail out (example)if
clause up such that we return early - e.g.if (this.isEnding){ return true; }
, makes my failing test pass but when i use the module in my main project, i getUncaught Error: write after end
...console.log()
calls, you instead getUncaught Error: Unexpected end
from sax (here). so there's a race going on in there somewhere (>_<)this.stream.end()
,this.stream._parser.close()
,this.stream.removeAllListeners()
, etc resulted in either an infinite loop + blown stack orUncaught Error: Unexpected end
from sax.fwiw, i'm running node v4.3.1 on os-x.
hope it helps! -matt