iriscouch / follow

Very stable, very reliable, NodeJS CouchDB _changes follower
Apache License 2.0
393 stars 82 forks source link

"catchup" event fires before final change #12

Open jhs opened 12 years ago

jhs commented 12 years ago

It looks like the "catchup" event fires before the final change.

There is a lot of code between receiving the JSON bob with .seq in it, and actually firing a "change" event if the caller wants to see it. Unfortunately the "catchup" logic happens in the former part of the code, when it should actually be the last thing done when processing data.

See https://github.com/iriscouch/follow/blob/master/lib/feed.js#L470-484