bug: listDocuments
filtering out design docs does not adhere to provided limit
#35
Labels
bug
Something isn't working
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.Suppose I have a DB with 2k docs, and 4 indexes. If I call
listDocuments
with alimit
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).The text was updated successfully, but these errors were encountered: