Hmmm, I guess this could use some documentation input @jamiltz Are there plans to make a page describing things like this?
Although to give a back of the napkin answer:
What to do when the replicator launch an exception ?
Analyze the exception to figure out what happened, and start the replication again if appropriate (this can be app logic dependent)
Start(), Stop(), Start()
There is not a specific prohibition on this, what happens when you try?
Using Stop() method
This is entirely up to you, though it is recommended to stop when the app enters the background to conserve battery life
Busy and replicator doing nothing
This should not happen. It it happens for more than 5 minutes (?) or so it is a bug (up to 5 minutes could be the web socket being interfered with and data not flowing)
Document in the bucket but not syncing
In general this is due to lack of required access to the document via the sync function
Connectivity lost
This is what the continuous mode is designed for. You should never need to react to connectivity changes as it should happen automatically in this mode. If for some reason it does not, and the replicator needs to stop it will notify via the changed callback (there are so many different exceptions to deal with and many are platform specific so it’s not entirely uncommon for one to slip through). For non-continuous, the replication will stop when connectivity is lost for too long or when the replication catches up to the changes it asked for.
Would be great to have you in my office, at least for a week
It’ what I’ve done : restart the replicator. But what to do when the exception said : “LiteCoreException (1005): no status code received” ?
It’s happening only with the UWP project. The Android don’t fire any exception, just stay busy and do nothing.
I have an exception, Something like : You can’t modify a dictionnary when it’s in use.
I’m displaying the progesses numbers, when they stop to increas, and the replication isn’t completed (stay in busy status), even if you wait for an hour, nothing will change. I always have to kill my app and start it again.
It wasn’t working, so I uninstalled my app from my computer, restarted it, and the replication goes fully (with many exceptions/restart of the replicator). I’m pretty sure that I can do it again just in using another mobile to add a document. How to follow what is happening ? Why the sync don’t do is job ?
If the replicator stop by itself, do we need to restart it ?
If the replicator stops, it will not start again unless you start it. If connectivity is lost during a continuous replication it will go into an offline state instead (which is not stopped).
Some of these issues sound like they warrant investigation. If you consistently face problems with exceptions then please start filing issues against the repo so that they can be investigated (especially the start stop start one, that one I’d like to look into). I’ve never seen the 1005 exception you mention, but my intuition says that this is web socket error code 1005 which means that no status code was sent from the server (which seems very odd. What does Sync Gateway have to say about that?)
I haven’t had problems with stuck replications lately (there were some on Windows back around DB019, but they were fixed in DB020).
Also I might sound like a broken record for this, but our functional replication testing is coming soon. We are currently working with QE to get this moving, and I hope that if I make enough noise it will move more quickly . Once that happens, it will be easier to set up test cases for things like this.
@steeve.descarpentrie, please file bug reports on Github when you run into things that are definitely bugs. Otherwise we may not ever find out about them or fix them.