PouchDB Replication throws error upon replication PouchDB Replication throws error upon replication google-chrome google-chrome

PouchDB Replication throws error upon replication


Note: I'm not able to solve the error you describe. Maybe a full stack trace rather than a screenshot might help...

But I will try to shed some light on the heartbeat parameter: Reading the docs already helps a little. See the advanced options for the replicate method:

options.heartbeat: Configure the heartbeat supported by CouchDB which keeps the change connection alive.

So let's look into CouchDB's docs to see what this parameter does:

Networks are a tricky beast, and sometimes you don’t know whether there are no changes coming or your network connection went stale. If you add another query parameter, heartbeat=N, where N is a number, CouchDB will send you a newline character each N milliseconds. As long as you are receiving newline characters, you know there are no new change notifications, but CouchDB is still ready to send you the next one when it occurs.

So basically it seems to be a polling mechanism that sends a message (f.e. a newline) every n milliseconds (where n is the heartbeat value you specify) to make sure the connection between two databases is still working.

Setting the value to false will disable this mechanism.


Regarding the which value can be used for this parameter:The PouchDB docs further state, that the changes method has a similar parameter described like this:

options.heartbeat: For http adapter only, time in milliseconds for server to give a heartbeat to keep long connections open. Defaults to 10000 (10 seconds), use false to disable the default.