I’m currently testing Couchbase.Lite in an UWP app with Sync Gateway. I always get this in the Gateway log:
GET /test/_blipsync (as test)
--> 404 feature not enabled (0.5 ms)
Tried with Walrus and Server 5.0.1 Community Edition, tried the Community and Enterprise Edition of the Sync Gateway 1.5.1.
This is my client code:
/* Create or open the database named app */
Database database = new Database("test");
var dict = new Dictionary<string, object>
{
["type"] = "task",
["owner"] = "todo",
["createdAt"] = DateTimeOffset.UtcNow
};
var newTask = new MutableDocument(dict);
database.Save(newTask);
/* Log the document ID (generated by the database)
and properties */
Debug.WriteLine($"Document ID :: {newTask.Id}");
Debug.WriteLine($"Learning {newTask.GetValue("type")} with {newTask.GetValue("owner")}");
/* Create replicators to push & pull changes to & from Sync Gateway. */
var url = new Uri("ws://localhost:4984/test");
var replConfig = new ReplicatorConfiguration(database, new Couchbase.Lite.Sync.URLEndpoint(url));
replConfig.Continuous = true;
replConfig.Authenticator = new Couchbase.Lite.Sync.BasicAuthenticator("test", "whatdoyouthink");
replConfig.ReplicatorType = ReplicatorType.Pull;
var replication = new Replicator(replConfig);
replication.AddChangeListener((sender, args) =>
{
string s = "";
switch (args.Status.Activity)
{
case ReplicatorActivityLevel.Stopped: s = "The replication is finished or hit a fatal error."; break;
case ReplicatorActivityLevel.Offline: s = "The replicator is offline as the remote host is unreachable."; break;
case ReplicatorActivityLevel.Connecting: s = " The replicator is connecting to the remote host."; break;
case ReplicatorActivityLevel.Idle: s = "The replication caught up with all the changes available from the server.The IDLE state is only used in continuous replications."; break;
case ReplicatorActivityLevel.Busy: s = "The replication is actively transferring data."; break;
}
Debug.WriteLine("REPLICATOR STATUS CHANGE: " + s);
if (args.Status.Error != null)
{
Console.WriteLine($"REPLICATOR ERROR: {args.Status.Error.Message}");
}
});
replication.Start();
Couchbase Lite is version 2.0.0-db022.