cloudant / sync-android

A JSON-based document datastore for Android applications
Apache License 2.0
267 stars 90 forks source link

`read`, `contains`, `create`, `delete` for local docs #591

Closed tomblench closed 6 years ago

tomblench commented 6 years ago

Checklist

Description

See #589 - allow users to interact with local docs via read, contains, create, and delete.

Note that other public API methods explicitly do not interact with local docs (eg changes).

Approach

Users can interact with local documents by using existing methods but prefixing the document ID with _local/. Where a document is returned, it retains its _local/ prefix.

Schema & API Changes

"No change"

Security and Privacy

"No change"

Testing

Added LocalDocumentCrud test class. This is fairly comprehensive and should also help document the expected behaviour for some corner cases.

Monitoring and Logging

Eventbus events are fired for local documents in a manner analogous to non-local documents (there are assertions for these in the tests).