This is a known consequence of the implementation. You're not the first to notice it. The problem is getRow calls an implicit start. Not ideal, I know. I'll think on how to fix this cleanly. As always, patches welcome.

Chris


On Dec 30, 2009, at 2:27 PM, "Joscha Feth" <[email protected]> wrote:

Hi there,

I was experiencing problems with _list functions lately, and I narrowed
down the problem:

list function A:
----------------
function(head,req) {
   if(true) {
       start({"code": 401});
   } else {
       start({"code": 200});
   }
}

list function B:
----------------
function(head,req) {
   getRow();
   if(true) {
       start({"code": 401});
   } else {
       start({"code": 200});
   }
}


as you can see A and B are completely identical except list function B
has an additional call to getRow().
Now I would expect those list functions to return the same result
(always return a 401), but list function B actually always returns a
200 - regardless of what code is given in start().
It seems as if the call to getRow() always makes the list function
return a 200. Is this a bug or am I missing something? I am on CouchDB
0.10 Windows.

regards,
Joscha

--


Reply via email to