Description
mobile-testkit framework has a generic function to create bulk documents, this function add documents whose data contains a key/value pair like below:
_id = doc_id_name
the key _id is considered as an illegal top-level key, 2.6.4.2-1 Android build capture this issue, however, not 2.7 or later CBL fail on this validation during the weekly test run.
Repro Steps:
1. use 2.7. or 2.8 CBL Android build
2. prepare a document like this:
MutableDocument document = new MutableDocument(id, data);
in this case, set id = cbl_1
and data = {channels=[ABC], dict_with_list=
, dict=
{name=zFakpGdcYp}, list=[2115284486470778685, 1745721136811925734], date_time_added=2020-04-15 11:55:22.303358, list_of_dicts=[
{friend_one=QYLGYazGqd},
{friend_two=VQYPpYGBJe}], _id=cbl_1, updates=0}
3. call database.save(document)
Expected Result:
save function throws exception:
CouchbaseLiteException
at com.couchbase.lite.CBLStatus.convertException(CBLStatus.java:81)
at com.couchbase.lite.CBLStatus.convertException(CBLStatus.java:32)
at com.couchbase.lite.AbstractDatabase.saveInTransaction(AbstractDatabase.java:1460)
at com.couchbase.lite.AbstractDatabase.saveInternal(AbstractDatabase.java:1366)
at com.couchbase.lite.AbstractDatabase.save(AbstractDatabase.java:399)
at com.couchbase.lite.Database.save(Database.java:31)
.......
Actual Result:
document is saved successfully, no validation check placed/failed