You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On call of changesReader.get it's expected that the request should pull changes till the last change then on('end' should be called
Current Behavior
Currently on call of changesReader.get({ includeDocs: true, since: changesSince, batchSize: 500 }) the changes are pulled but on('end', () => {...}) never gets called. So I can't tell when all the changes have been pulled.
Your Environment
Version used: 10.1.0
Browser Name and version: N/A
Running in node app: 16.17.0
Operating System and version (desktop or mobile):
Link to your project:
The text was updated successfully, but these errors were encountered:
I guess that the issue lies in changesreader.js, when batchSize > 1:
// stop on empty batchif(self.stopOnEmptyChanges&&data&&typeofdata.results!=='undefined'&&data.results.length===0){self.continue=false}
The reader is supposed to emit end when self.continue === false. But when the batch size is more than 1, the last batch will likely contain some elements (almost never 0), and thus the condition data.results.length === 0 will never be met. Maybe we should set self.continue to false when data.pending === 0 as well?
Expected Behavior
On call of
changesReader.get
it's expected that the request should pull changes till the last change thenon('end'
should be calledCurrent Behavior
Currently on call of
changesReader.get({ includeDocs: true, since: changesSince, batchSize: 500 })
the changes are pulled buton('end', () => {...})
never gets called. So I can't tell when all the changes have been pulled.Your Environment
The text was updated successfully, but these errors were encountered: