cordova - Couchbase mobile replication through REST-API -
while trying integrate couchbase mobile (version 1.1.0) in our hybrid mobile app (ionic), ran issue push replication on ios.
at point in application (after local database has been created , on) design document views created successfully. continuous push , pull replication created , started well.
when polling push replication status noticed had stopped (not normal continous replication) shortly after had been started.
couchbase mobile replied error (404)
warning: cbl_pusher[http://server:4985/bucket-sync-gateway]: _bulk_docs got error: { error = "bad_request"; id = "_design/app"; reason = "invalid doc id"; status = 400; }
the sync gateway logged similar error:
bulkdocs: doc "_design/app" --> 400 invalid doc id (400 invalid doc id)
this happens on ios. android version doesn't have issues replications (maybe design documents ignored?)
- why replication try sync design documents on ios , not on android?
- should design documents synched?
- is there way prevent document of being synched? (native api's provide filtering mechanism on replications, rest-api not)
any idea problem here?
cheers,
bert
which versions of couchbase lite , sync gateway using? believe behavior has improved in version 1.1 of each. specifically, sync gateway returns 403 forbidden instead of 400 bad request when client attempts upload design document. couchbase lite replicator keep going after status instead of stopping error.
design documents problematic since contain executable (javascript) code in form of map, reduce or filter functions. security reasons sync gateway (like couchdb) won't allow non-admin client upload one.
worse, violation of apple developer agreement have ios app download design doc, since apps aren't allowed execute downloaded code. (the reason "probably" because exception javascript code running in web browser. design doc contain js, , phonegap app code run in browser, map/reduce/filter functions run not in browser in separate js context invoked couchbase lite. not lawyer , have no idea apple think of that. knowledge it's never come up.)
—jens alfke (mobile architect, couchbase)
Comments
Post a Comment