In that case, both initial/start replications aren't running in parralel, instead of that, we're running the replication from server to local firstly. The reason behide that is, we're assuming, in the case of conflict, the server would win. So when we run the replication from local to server, the chance to appear conflicts will be very small.
So, if everything goes well, every conflict will be resolved and everything will be in sync before we start the 2-way live replication, where the conflicts probably will be resolved as soon than appear.
If you think I'm being too cautious, I'm really open to suggestions.
Hmm, I think possibility of conflicts does not depend on the order of replication, if a user tries to update an outdated record, conflict is inevitable. But perhaps how conflicts are resolved does depend on this order, I will need to test my cases to figure this out I think.
All depends on your conflict resolution strategy. I usually prioritize the server for two reasons.
The first is that the documents may have been replicated to other devices, so the unique affected device is the current one.
secondly it's cheaper to solve locally, pouchdb will not throw a 409 and force you to send other web request. at this point, you can easily ignore/delete the local document or compare both.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
you're right, but that isn't what we're doing here.:
is equivalent to:
In that case, both initial/start replications aren't running in parralel, instead of that, we're running the replication from
server
tolocal
firstly. The reason behide that is, we're assuming, in the case of conflict, the server would win. So when we run the replication fromlocal
toserver
, the chance to appear conflicts will be very small.So, if everything goes well, every conflict will be resolved and everything will be in sync before we start the 2-way live replication, where the conflicts probably will be resolved as soon than appear.
If you think I'm being too cautious, I'm really open to suggestions.
Hmm, I think possibility of conflicts does not depend on the order of replication, if a user tries to update an outdated record, conflict is inevitable. But perhaps how conflicts are resolved does depend on this order, I will need to test my cases to figure this out I think.
TL;DR, I'm avoiding 409 responses.
All depends on your conflict resolution strategy. I usually prioritize the server for two reasons.
The first is that the documents may have been replicated to other devices, so the unique affected device is the current one.
secondly it's cheaper to solve locally, pouchdb will not throw a 409 and force you to send other web request. at this point, you can easily ignore/delete the local document or compare both.