-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
listDocuments filters out design documents from Couch response, before returning the list back. This is to prevent design docs from being sent back to the consumer, thus leaking implementation details about the underlying datastore. This can result in unexpected behavior.
In Couch, an index is stored as a special document called a "design document"
Suppose I have a DB with 2k docs, and 4 indexes. If I call listDocuments with a limit of 1000, the adapter will receive 1000 documents from Couch. If there are any index design documents in that response, say 2, then the adapter will filter them out, thus returning 998 documents to caller, not 1000. The caller could interpret this as not enough documents exist in the DB, to satisfy the provided limit, even though there are 2k documents in the DB.
We'll need to figure out how to take design documents into account on listDocuments. Do we continue to filter them out? If so, do we make an additional call to the DB to "replace" any filtered out design documents? Or do we just include design documents in the response (I think this leaks details about Couch, but open to debate).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status