Trying to sync cbl 2.0.0-db020 X sync gateway 1.5 X Couchbase Server 1.5 but it’s not syncing, here is my code:
jsonConfig:
{ "log": ["*"], "adminInterface": "127.0.0.1:4985", "interface": "0.0.0.0:4984", "databases": { "ecomanda": { "server": "http://localhost:8091", "bucket": "ecomanda", "enable_shared_bucket_access": true, "import_docs": "continuous", "username": "Administrator", "password": "alexandrem", "users": { "GUEST": { "disabled": false, "admin_channels": [ "*" ] } }, "unsupported": { "replicator_2": true }, "sync": `function (doc, oldDoc) { channel('public'); console.log(doc); }` } } }
If i open http://localhost:4984/ecomanda/ on browser, it shows: (looks ok)
{“committed_update_seq”:1,“compact_running”:false,“db_name”:“ecomanda”,“disk_format_version”:0,“instance_start_time”:1511529249787388,“purge_seq”:0,“state”:“Online”,“update_seq”:1}`
Here is My c# WPF Test:
readonly Database _db;
string id = Guid.NewGuid().ToString();
readonly Replicator _rep;
public MainWindow()
{
InitializeComponent();
Couchbase.Lite.Support.NetDesktop.Activate();
_db = new Database("ecomanda");
var config = new ReplicatorConfiguration(_db, new Uri("ws://localhost:4984/ecomanda"))
{
Continuous = true
};
//config.Authenticator = new Couchbase.Lite.Sync.BasicAuthenticator("Administrator", "alexandrem");
_rep = new Replicator(config);
_rep.Start();
_rep.StatusChanged += (sender, e) => {
if (e.Status.Activity == ReplicatorActivityLevel.Stopped)
{
Console.WriteLine("Replication has completed.");
}
};
}
private void Get_Click(object sender, RoutedEventArgs e)
{
var doc = _db.GetDocument(id);
Debug.Write(doc);
MessageBox.Show(doc.Id.ToString());
}
private void Save_Click(object sender, RoutedEventArgs e)
{
var doc = new MutableDocument(id);
doc.Set("xpto", "abc");
_db.Save(doc);
}
protected override void OnClosing(CancelEventArgs e)
{
_rep.Stop();
base.OnClosing(e);
}
When I hit “Save” The Sync Gateway console does nothing nor CB Server get any data
Here is the SG Console:
Any help?
Tks