Bulkdocs throwing error while replication and stops the replication process by aborting the connection.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
### Info
- Environment: Electron/Angular
- Platform: Windows Desktop Application
- Adapter: idb
- Server: CouchDB
### Versions
- PouchDB: 7.3.2
- Electron: 13.0.0
- CouchDB: 2.3.1
- Angular: 12
### Issue
Couch-to-pouch replication throws the CustomPouchError with the reason Timeout Error and aborts the connection. When we try to debug it, we find that it is failing at writing docs to pouchDb using **target.bulkdocs.**

Below is the message that is getting printed to the console when replication halts.

### Reproduce
Selecting a project from the dropdown will start the replication of that project data from couch to pouch. Each project will have different document counts ranging from 100 to a few thousand.
Below are the options that we are using for the replication process
**retry**: true,
**live**: true,
**selector**: {projectNumber: “FA SUCROSE”}, (project number will be set dynamically by users selection)
**batchSize**: 500
Below are our pouchDb options
**auto_compaction**: true,
**revs_limit**: 5
After a few initial requests, the replication process stops and the connection will be closed.
We tried different batch sizes ranging from 20 to 500. Even with batch size 20, we faced this issue more than a couple of times and it is taking a long time to complete the replication process.
This issue occurred for us while replicating a small project with 600+ docs and also for a project with 4000+ docs.
After this error pouchDb connection is closed and throws the same error repeatedly even user selects different project to replicate.

Please advise on how to avoid this type of error and continue smoothly with the replication process.
Contributor guide
Assessment
This issue has not been assessed yet.