Error status 409 after setting new cookie

Hi,

I’m using a custom authentication in my application as described in the docs. This works as expected however I see the following outputs in the Logcat once I replace the Cookie (e.g. after my session expired):

02-28 19:58:29.473 9533-17145 E/RemoteRequest: Got error status: 409 for [MY_URL]/my_bucket/_local/7d57db74c6de5cae09635d027108a94c8867e51e.  Reason: Conflict
02-28 19:58:29.476 9533-17145 W/Sync: com.couchbase.lite.replicator.ReplicationInternal$7@98cf01c: Unable to save remote checkpoint
                                      org.apache.http.client.HttpResponseException: Conflict
                                          at com.couchbase.lite.support.RemoteRequest.executeRequest(RemoteRequest.java:202)
                                          at com.couchbase.lite.support.RemoteRequest.run(RemoteRequest.java:102)
                                          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
                                          at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
                                          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                          at java.lang.Thread.run(Thread.java:818)

The Sync continues to work as expected but the error keeps coming up in the Logcat until I completely restart the application.
So basically the questions are:

  1. Why does this error occur?
  2. Do I need to care about it?
  3. Any negative outcome if I ignore it?

Following happens in the application when I receive a 401 - Unauthorized exception.

  • In Replication.ChangeListener() I receive a HttpResponseException with statusCode 401
  • An Observer notifies an activity
  • The activity pauses the sync (pullReplication.stop() and pushReplication.stop()) and sends a Session-Request to my App Server
  • App Server creates new session and sends it back to client
  • Client (activity) sets the new cookie for the push- and pull replication and continues the sync like so:
pullReplication.setCookie(cookieName, newCookieValue, "/", expirationDate, isSecure, httpOnly);
pushReplication.setCookie(cookieName, newCookieValue, "/", expirationDate, isSecure, httpOnly);
pullReplication.start();
pushReplication.start();

Afterwards the sync works again without the 401 - Unauthorized errors but the 409er keep coming up as described in the beginning of this post.
Do I need to do anything else? I also tried calling the #deleteCookie(cookieName) but this didn’t change anything.

Thanks.