Just succesfully got the example working: xamarin userprofile_sync
Using docker for both couchdb and the gateway. Gateway runs in walrus mode and that works. But now I switched to my real database but this does not work.
I am a bit further and found quite a lot erros on my side.
However, now I am receiving the following error:
2020-03-04T12:18:26.305Z [INF] HTTP: #013: GET /taakbeheerser/_blipsync
2020-03-04T12:18:26.307Z [INF] HTTP auth failed for username=" test"
2020-03-04T12:18:26.307Z [INF] HTTP: #013: --> 401 Invalid login (2.6 ms)
“interface”:":4984",
“log”: ["*"],
“databases”: {
“taakbeheerser”: {
“server”: “http://192.168.1.205:8091”,
“users”: { “test”: { “password”: “password”} },
“bucket”: “default”,
“username”: “sync_gateway”,
“password”: “password”,
“enable_shared_bucket_access”: true,
“import_docs”: “continuous”,
“num_index_replicas”: 0,
“sync”: function (doc, oldDoc) { if (doc.sdk) { channel(doc.sdk); } }
}
I am supplying the users credential to the BasicAuthenticator for replication. When starting the replicator I see the invalid login in the log file.
Additional question is: I want to have the data in the local db also in the cloud database. How is this supposed to be configured? Are changes via the gateway pushed to the database? In other words, if the auth problem is fixed changes are committed to the couchbase cloud db?
Yes, that’s what the Couchbase Lite replicator does. If you enable pull replication, changes on the server get pulled into the device. If you enable push, changes from the device get pushed to the server.
Once I add something via one instance of the application it is now added in the remote db too. If I start another instance of the application the remote data is not arriving on this instance. I see the events coming in.
Where do I define that? I see that with a user I can specify admin channels but in the examples I don’t see any further configuration unless I overlooked something?
Finally got to work again on this… unfortunately still no success.
I added the channel that is specified in ```
channel(“channel.” + doc.doc_type);
into the admin_channels property of the user:
"test": {
"password": "password",
"admin_channels": ["channel.Name"]
},
But the changes are only coming in for the client that is pushing them. Another client with the same user does not receive updates. Also upon starting up a sync is not performed.
What else can I do to tackle this?
Got it working but only when using the ‘access’ method in the sync function. I am using roles now and give that role access via the sync function. I could not get predefined access working.
This does not make sense. You said you were using the user profile tutorial app and it worked with walrus and you switched to a real database and it fails ? ?
access call is an expensive operation so if you are using it within the sync function, you need to ensure that its not redundant.
The "admin_channels": ["channel.Name"] does not seem right. Do you have a channel with the literal name of “channel.Name” ?