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
    java.lang.IllegalArgumentException: Invalid % sequence: %&- in path at 
index 31: http://10.69.31.233:7985/gw/£%&-7?new_edits=false
            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)

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/5a8b57d7-4865-4087-a9cd-68b86925341c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to