couchrest/couchrest — pull request #104 by azul (2014-06-27 11:44:11+00:00)
Title: Preserve the first change in continuous feeds

solves #91

Couch will send valid json hashes from the first line of continuous changes feeds on. So we may not drop that line.

The regexp in parse_line will already catch the headers. So we can use it to test if the first line was only a header or containing a change.

This implementation will store the first line that does not get parsed in first. This might not always be a header but i can't think of any couch document that would cause this to misbehave. In the worst case the first non parsing line and the last line will be combined and parsed again.