Details
-
Task
-
Resolution: Fixed
-
Major
-
Mobile 2.1
Description
In the REST API docs for getting a document ( https://docs.couchbase.com/sync-gateway/2.1/rest-api.html#/document/get_db_doc) it mentions::]
open_revs: Option to fetch specified revisions of the document. The value can be all to fetch all leaf revisions or an array of revision numbers (i.e. open_revs=["rev1", “rev2”]). If this option is specified the response will be in multipart format. Use the Accept: application/json request header to get the result as a JSON object.
This should be updated to add the caveat that the revision body might have already been compacted away. For non-leaf revisions, this happens after 5 minutes of the update that made it into a non-leaf revision.
So if a user is trying to get a non-leaf revision body from Sync Gateway, there are only two cases where they will be able to do so:
- It's within the 5 minute expiry time window
- The revision body happens to be resident in the revision cache of that gateway node
Another caveat to trying to get older revisions is that the revision may have already been pruned away, as described in https://blog.couchbase.com/database-sizes-and-conflict-resolution/. Although, maybe that is better documented (or already documented) in the revs_limit configuration setting.