Details
Description
LenLeft can still go negative. While the guard clause prevents an earlier bug, replication fails when it hits this issue.
In the following case, LenLeft is -673327 which matches no clauses (we expect either 0 or > 0). Somehow we are starting with a LenLeft value lower than the number of bytes we subsequently receive.
{function_clause,
[
,
,
,
,
,
{couch_db,'-update_docs/4-lc$^2/1-2-',2}
,
]}}