You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Zachary Zolton (JIRA)" <ji...@apache.org> on 2009/09/28 20:21:15 UTC

[jira] Created: (COUCHDB-514) Redirect from _list using view rows

Redirect from _list using view rows
-----------------------------------

                 Key: COUCHDB-514
                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
             Project: CouchDB
          Issue Type: Improvement
          Components: JavaScript View Server
    Affects Versions: 0.10
            Reporter: Zachary Zolton


There is no way to redirect from a _list function after calling the getRow() API function.

Here's a link to the discussion on the dev mailing list:
http://is.gd/3KZRg


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (COUCHDB-514) Redirect from _list using view rows

Posted by Zachary Zolton <za...@gmail.com>.
Thanks for the direction; I'll give it a whirl tomorrow morning.

On Wed, Nov 11, 2009 at 8:38 PM, Paul Joseph Davis (JIRA)
<ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776802#action_12776802 ]
>
> Paul Joseph Davis commented on COUCHDB-514:
> -------------------------------------------
>
> Ohhhh.
>
> The reason that Zachary's patch won't work is that the Erlang side is waiting for the start before sending the first row. The "getRow()" style API in JavaScript is still bound by the serialized enforcement that the Erlang side does. Sadly that means the patch is more involved than I had initially thought.
>
> For interested parties, the fix for this is in reworking how couch_httpd_show.erl uses the btree fold function. Basically, in couch_httpd_show:start_list_resp/5 the proper thing would be to just send the head info and defer the response building till later in the iteration process when render_list_row is called.
>
>> Redirect from _list using view rows
>> -----------------------------------
>>
>>                 Key: COUCHDB-514
>>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>>             Project: CouchDB
>>          Issue Type: Improvement
>>          Components: JavaScript View Server
>>    Affects Versions: 0.10
>>            Reporter: Zachary Zolton
>>         Attachments: list-redir.diff, list_views.diff
>>
>>
>> There is no way to redirect from a _list function after calling the getRow() API function.
>> Here's a link to the discussion on the dev mailing list:
>> http://is.gd/3KZRg
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Updated: (COUCHDB-514) Redirect from _list using view rows

Posted by "Yohei Sasaki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yohei Sasaki updated COUCHDB-514:
---------------------------------

    Attachment: list_views.diff

I'm troubled with the similar problem to this issue. 

I attached a patch(for svn:rev834436) for adding javascript test case(share/www/test/list_views.js). 
This test case would be passed when Erlang side is fixed.


> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff, list_views.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-514) Redirect from _list using view rows

Posted by "Joscha Feth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joscha Feth updated COUCHDB-514:
--------------------------------

    Attachment: render.diff

Added render.diff which enables the list render function to disable/enable automatic flushing and fixes the problem with start() being sent automatically when getRow() gets called. Needs readline() to be fixed first to also return if there is no header sent, yet.

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff, list_views.diff, render.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (COUCHDB-514) Redirect from _list using view rows

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Anderson reassigned COUCHDB-514:
--------------------------------------

    Assignee: Chris Anderson

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>            Assignee: Chris Anderson
>         Attachments: list-redir.diff, list_views.diff, render.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-514) Redirect from _list using view rows

Posted by "Zachary Zolton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zachary Zolton updated COUCHDB-514:
-----------------------------------

    Attachment: list-redir.diff

This patch (from a reasonably current HEAD on github) shows how I was attempting to get the JavaScript view server to defer sending the headers until after the first time send() is called.

Unfortunately, this code doesn't work, but I'm attaching it here to encourage some dialog... :^D

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-514) Redirect from _list using view rows

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis updated COUCHDB-514:
--------------------------------------

    Skill Level: Regular Contributors Level (Easy to Medium)

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>            Assignee: Chris Anderson
>         Attachments: list-redir.diff, list_views.diff, render.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-514) Redirect from _list using view rows

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776596#action_12776596 ] 

Paul Joseph Davis commented on COUCHDB-514:
-------------------------------------------

Hmm, Zachary looks like he's going in the right direction with his patch. I'll try and get to this tonight or tomorrow to see if we can get something worked out.

Yohei, thanks for the failing test case. That should be most useful in fixing this.

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff, list_views.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-514) Redirect from _list using view rows

Posted by "Yohei Sasaki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776455#action_12776455 ] 

Yohei Sasaki commented on COUCHDB-514:
--------------------------------------

I'm troubled with the similar problem to this issue.
I attached a patch(for svn:rev834436) for adding javascript test case(share/www/test/list_views.js).
This test case would be passed, when Erlang side is fixed.

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-514) Redirect from _list using view rows

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804920#action_12804920 ] 

Chris Anderson commented on COUCHDB-514:
----------------------------------------

Joscha,

If you can provide just the bug fix (not _stylistic changes) I'll be glad to help you finish it.

I do think this will require an Erlang fix. I won't let it slip past 1.0 but I don't have time to write it before 0.11

Chris


> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff, list_views.diff, render.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-514) Redirect from _list using view rows

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12776802#action_12776802 ] 

Paul Joseph Davis commented on COUCHDB-514:
-------------------------------------------

Ohhhh.

The reason that Zachary's patch won't work is that the Erlang side is waiting for the start before sending the first row. The "getRow()" style API in JavaScript is still bound by the serialized enforcement that the Erlang side does. Sadly that means the patch is more involved than I had initially thought.

For interested parties, the fix for this is in reworking how couch_httpd_show.erl uses the btree fold function. Basically, in couch_httpd_show:start_list_resp/5 the proper thing would be to just send the head info and defer the response building till later in the iteration process when render_list_row is called.

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff, list_views.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-514) Redirect from _list using view rows

Posted by "Yohei Sasaki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yohei Sasaki updated COUCHDB-514:
---------------------------------

    Comment: was deleted

(was: I'm troubled with the similar problem to this issue.
I attached a patch(for svn:rev834436) for adding javascript test case(share/www/test/list_views.js).
This test case would be passed, when Erlang side is fixed.)

> Redirect from _list using view rows
> -----------------------------------
>
>                 Key: COUCHDB-514
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-514
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>    Affects Versions: 0.10
>            Reporter: Zachary Zolton
>         Attachments: list-redir.diff
>
>
> There is no way to redirect from a _list function after calling the getRow() API function.
> Here's a link to the discussion on the dev mailing list:
> http://is.gd/3KZRg

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.