Skip to content

Commit

Permalink
Fixes #601 Fixes #602
Browse files Browse the repository at this point in the history
  • Loading branch information
borrrden committed Mar 4, 2016
1 parent 2b5c891 commit 7708f82
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Couchbase.Lite.Shared/Replication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,9 +1262,7 @@ internal HttpRequestMessage SendAsyncRequest(HttpMethod method, Uri url, Object
if(response.IsCanceled) {
error = new Exception("SendAsyncRequest Task has been canceled.");
} else {
error = error is AggregateException
? response.Exception.Flatten()
: response.Exception;
error = Extensions.Flatten(response.Exception);
}

if(error == null) {
Expand Down Expand Up @@ -1737,6 +1735,7 @@ private void FetchRemoteCheckpointDoc()
Log.V(TAG, "{0} replicating from lastSequence={1}", _replicatorID, LastSequence);
} else {
Log.V(TAG, "{0} lastSequence mismatch: I had {1}, remote had {2}", _replicatorID, localLastSequence, remoteLastSequence);
_lastSequence = "0";
}

BeginReplicating ();
Expand Down
15 changes: 15 additions & 0 deletions src/Couchbase.Lite.Tests.Shared/PeerToPeerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
using System.Net.Security;
using Couchbase.Lite.Security;
using System.Text;
using System.Threading.Tasks;

namespace Couchbase.Lite
{
Expand Down Expand Up @@ -87,6 +88,20 @@ public void TestExternalReplicationStart()
Assert.AreEqual(10, createdDb.GetDocumentCount());
}

[Test]
public void TestRecreatedEndpoint()
{
CreateDocs(database, false);
var repl = CreateReplication(database, true);
RunReplication(repl);

Thread.Sleep(1000);
_listenerDB.Delete();
_listenerDB = EnsureEmptyDatabase(LISTENER_DB_NAME);
RunReplication(repl);
VerifyDocs(_listenerDB, false);
}

[Test]
public void TestSsl()
{
Expand Down

0 comments on commit 7708f82

Please sign in to comment.