Hi there,
I’m looking for advice or tips to what to look for.
I have sync gateway (2.7) with the following sync configuration :
"db-prod": {
"server": "http://172.18.64.81:8091",
"bucket": "pulse",
"username": "**",
"password": "****",
"enable_shared_bucket_access": true,
"import_docs": true,
"num_index_replicas": 0,
"allow_conflicts": false,
"revs_limit": 20,
"users": {
"GUEST": { "disabled": true, "admin_channels": ["*"] },
"sync_g_user": {"password": "***", "admin_channels":["*"] }
},
"sync": `function (doc, oldDoc) {
if (doc.type === 'pulseAgency' && doc.ageInternalCode) {
access("sync_g_user", doc.ageInternalCode);
}
if (doc.sysSyncActive && doc.sysSyncChannel) {
channel(doc.sysSyncChannel);
}
}`
}
}
The doc.sysSyncChannel is an array of strings (ie : [“demo”, “pls69t”]…)
We then have CBL on android and ios (2.8.0). When a user log in on the mobile app, we set up the replication this way :
ReplicatorConfiguration config = new ReplicatorConfiguration(database, targetEndpoint);
// Limitation au channel de l'utilisateur
config.setChannels(Collections.singletonList(syncChannel));
config.setContinuous(true);
config.setReplicatorType(ReplicatorConfiguration.ReplicatorType.PUSH_AND_PULL);
// Authentification
config.setAuthenticator(new BasicAuthenticator(syncUsername, syncPassword));
replicator = new Replicator(config);
The syncChannel option being a string, like “demo”, or “pls69t”. One user can only set up replication for one channel. The only way to set up replication for another channel is to uninstall and reinstall the mobile application.
We have been using this configuration for almost 2 years now, and everything was fine.
Recently, we had a synchronization problem with 2 users : for the first user, on iOS, using the channel “channel1” for example, he had documents for “channel1”, but found also documents for another channel. We know for sure thoses documents always had their channels, and those never changed. The strange thing is that this was not a mixup between several channels, but only between 2.
The second user had the same problem, but with 2 other channels, and on Android.
My question is : where should I look ? I don’t know if this is something wrong in our code, on the mobile application or on the sync gateway configuration, or if for a reason I don’t understand sync gateway somethings mixes things up ? Is it possible ?
Tell me if you need more informations or details regarding this.
Thanks a lot
Jérémie