I recently found out that custom doc_id is not validated on iOS/Android (might be true for other platforms).
So it is possible to pass something like: "£%&-7", which causes exception on SyncGateway (no crash).
Is this correct behaviour for Couchbase Lite frameworks?, I could not find anything about this on the web and in CBL documentation.
But Database name is checked for legal characters:
https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/API/CBLManager.m#L376 (and it is written in the documentation)
---- Sync gateway (1.0.0) confused with some doc ids:
----
15:19:44.729250 CRUD+: Invoking sync on doc "£%&-7" rev 2-d36047fd7682b8f3255a0652ba510790
15:19:44.729562 CRUD+: No old revision "£%&-7" / "1-691feb51f7ea0da0c8e56132396a0451"
15:19:44.729856 WARNING: Sync fn exception: 400 Illegal channel name "person-£%&-7"; doc = map[_id:£%&-7 type:Person _revisions:map[start:%!s(float64=2) ids:[d36047fd7682b8f3255a0652ba510790 691feb51f7ea0da0c8e56132396a0451]] _rev:2-d36047fd7682b8f3255a0652ba510790] -- db.(*Database).getChannelsAndAccess() at crud.go:686
15:19:44.729873 BulkDocs: Doc "£%&-7" --> 500 Exception in JS sync function (500 Exception in JS sync function)
--- CBL lite library (1.0.3) can be confused too, but only when it is trying to sync it to GW.
---
RemoteRequestCompletionBlock throw Exception
at java.net.URI.create(URI.java:730)
at org.apache.http.client.methods.HttpPut.<init>(HttpPut.java:71)
at com.couchbase.lite.support.RemoteRequest.createConcreteRequest(RemoteRequest.java:146)