-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync issues when more than three databases #80
Comments
Hi! I experienced the same issue but without pouchdb-react-native. |
What solutions are you using when you want to sync more than 4 databases ? You sync manually with some timer ? |
And why does it has a limit of 4 connections ? Is this iOS? The PouchDB lib? This RN port ? cc @stockulus and @Dallas62 |
Hi! I just find this: But not tested. My solution was: I made a kind of "queue", at first, place all your collections in this queue, then sync same one by one and replay the queue. Then you should be able to create a more intelligent system like: Sync this collection every Xs, this one Ys, ... and find the right way to sync same manually. I also added a "force sync" to be sure data are saved when a user made changes but there is no magic way with this limitation (iOS). Hope it will help you. |
We found a mysterious behavior by investigating some trouble we had. After a lot of debugging we boiled it down to the number of databases we want to sync with a couchdb instance.
Below you'll find a minimal example:
https://www.dropbox.com/sh/71r0jkdi05e58zx/AABtzR2kEESYYnQIib99Wlg4a?dl=0
Here are the steps to reproduce the behavior (also described in readme.txt):
react-native init Test_Pouch_Sync
(1) npm install
(2) react-native link
4a. Start Project in Emulator/on Device in Debugging mode
e.g. react-native run-android
5a. run "node TestUpdates.js" in other shell/command prompt
each time, one attribute in DB test1 will be changed the changes should be triggered inside app as well)
Now Delete return in line 67 of index.android.js (5 DBs synced instead of only 3)
4b. Start Project in Emulator/on Device in Debugging mode
e.g. react-native run-android
5b. run "node TestUpdates.js" in other shell/command prompt
each time, one attribute in DB test1 will be changed.
Change event is no longer triggered inside app.
Instead we get:
CustomPouchError {code: "ETIMEDOUT", status: 0, docId: "_local/pJITKVlq12xx5VD44sPWHg%3D%3D", result: Object}
Note: The error does not occur in PouchDB (not react-native)! SimulateSyncs.js contains pretty much the same code than the RN app. run "node SimulateSyncs.js" instead of the app to test. Here, all changes trigger an event, even when 5 DBs are synced.
The text was updated successfully, but these errors were encountered: