Introduction
We are using PouchDB 7.2.1 to synchronize a mobile PWA with a CouchDB to build up a Shared Context. In order to achieve this we use the bidirectional sync method from PouchDB. In the following code snippet you can see our parameters.
PouchDB.sync(
POUCH_DB,
`${internalUrl}/couchdb/${POUCH_DB}`,
{
auth: {
username: username,
password: password
},
live: true,
retry: true
};
The communication path can be described as:
PWA <---> Nginx (Reverse Proxy) <---> CouchDB (as a Docker-Container)
Description of the problem
PouchDB works well on PCs, iOS and some Android devices. From time to time, the long pool request on an Android device is frozen or does not disconnect, and PouchDB stopped the bidirectional synchronization. The client does not receive no updates anymore. The following snippet shows of the last request, we have recieved at our reverse proxy (nginx).
IP-Address - USER [17/Jan/2023:18:16:07 +0100] "GET /couchdb/dbname/_changes?style=all_docs&feed=longpoll&heartbeat=10000&since=...&limit=1
We have already checked:
Hopefully, someone have a possible solution for this problem.
Thanks to LyteFM. His comment helped us to isolate the problem. We had a CouchDB Version prior 3.3.0. An upgrade to CouchDB to 3.3.1 solved our problem.