[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: Redirect from _list function?
Guys, I've started a ticket for this: https://issues.apache.org/jira/browse/COUCHDB-514 I don't know what level of effort would be required to fix this, or if this is even compatible with the current view server protocol. I'm motivated to solve this, but I'd need some coaching from someone with more knowledge of CouchDB view server internals. Cheers, Zach On Sun, Sep 27, 2009 at 11:35 PM, Chris Anderson jch...@apache.org wrote: On Sun, Sep 27, 2009 at 8:26 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hmm... I can't do anything that doesn't result in a view server timeout. (^_-) Shall I open an issue? I can discuss what I tried, as well... It never hurts to start a ticket. Especially if you have patches. Thinking about it more, it seems like the Erlang side is gonna be looking for that start signal before it will send a row. We'll need to design a dont-start signal, so that it can get a row without sending headers. On Sun, Sep 27, 2009 at 12:06 PM, Paul Davis paul.joseph.da...@gmail.com wrote: On Sun, Sep 27, 2009 at 1:04 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hey guys, newb question for you: the make script concatenates all the /share/server/*.js scripts into main.js, right? yepper. I'm still trying to figure this stuff out... On Sat, Sep 26, 2009 at 11:35 PM, Zachary Zolton zachary.zol...@gmail.com wrote: I'll start studying the query_server_spec.rb script; I think I might be able to handle this in JavaScript... On Sat, Sep 26, 2009 at 11:22 PM, Chris Anderson jch...@apache.org wrote: On Sat, Sep 26, 2009 at 8:57 PM, Paul Davis paul.joseph.da...@gmail.com wrote: its been awhile since i studied the Erlang side of this, but IIRC, once getRow() returns, the response has started which means that you can't send a redirect. To get it working proper then would require a bit of a patch to wait on starting the response until the first output from the _list function. Yes I think it would be a simple patch, once you understand the entrails of the _list system. You should read the query_server_spec.rb to see what gets sent by the query server on first getRow() call. It may be that this patch can be accomplished just in the javascript side. Chris Paul Davis On Sat, Sep 26, 2009 at 11:39 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hey guys, I need to find a way to do a redirect from a _list function after calling the getRow() function. After looking at render.js for a while I can't see how to solve this without at least adding to the API. Basically, I think that calling getRow() shouldn't cause the view server to send the headers (or awaiting chunks) unless we've already called send() or something like that. That way, we can return from the _list function after iterating to the first row that should redirect. (I'm not sure if this is a breaking change from the current semantics, however...) Would greatly appreciate a little guidance on how to attack this! Cheers, Zach -- Forwarded message -- From: Chris Anderson jch...@apache.org Date: Fri, Sep 25, 2009 at 2:15 PM Subject: Re: Redirect from _list function? To: Zachary Zolton zachary.zol...@gmail.com On Fri, Sep 25, 2009 at 11:01 AM, Zachary Zolton zachary.zol...@gmail.com wrote: So, now I find that using the send() function to perform the redirect doesn't work after the first time I call getRow(). Upon checking out render.js, I see that the getRow() function calls sendStart()—which I haven't quite yet figured out—but I can tell there's something fishy going on there... Would I be correct to assume that the headers are already set after calling getRow()? Yes... The headers are sent when the first getRow is called. Fixing this is definitely something I'd support. On Fri, Sep 25, 2009 at 12:11 PM, Chris Anderson jch...@apache.org wrote: On Fri, Sep 25, 2009 at 8:40 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Okay, I've update this section to differentiate between the 0.9 and 0.10 _list API: http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Sending_a_Redirect Now, I'm feeling that the Other Fun Things section could use a bit of love. Hmm... :^) Thanks for keeping the wiki in mind! On Fri, Sep 25, 2009 at 10:19 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Sweet! I'll try to amend the wiki page for the _list API... On Fri, Sep 25, 2009 at 10:17 AM, Jason Davies ja...@jasondavies.com wrote: On 25 Sep 2009, at 16:16, Zachary Zolton wrote: Thanks for all the help, guys! Shall I delete that JIRA issue? I already did :-) -- Jason Davies www.jasondavies.com -- Chris Anderson http://jchrisa.net http://couch.io -- Chris Anderson http://jchrisa.net http://couch.io -- Chris Anderson http://jchrisa.net http://couch.io -- Chris Anderson http://jchrisa.net http://couch.io
Re: Redirect from _list function?
On Mon, Sep 28, 2009 at 11:34 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Guys, I've started a ticket for this: https://issues.apache.org/jira/browse/COUCHDB-514 I don't know what level of effort would be required to fix this, or if this is even compatible with the current view server protocol. I'm motivated to solve this, but I'd need some coaching from someone with more knowledge of CouchDB view server internals. I'm into getting this to happen too. I barely have time, but I can advise. It wouldn't hurt to post a patch of what you tried, even if it didn;t work, as it will let other know which code you are digging into. Chris Cheers, Zach On Sun, Sep 27, 2009 at 11:35 PM, Chris Anderson jch...@apache.org wrote: On Sun, Sep 27, 2009 at 8:26 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hmm... I can't do anything that doesn't result in a view server timeout. (^_-) Shall I open an issue? I can discuss what I tried, as well... It never hurts to start a ticket. Especially if you have patches. Thinking about it more, it seems like the Erlang side is gonna be looking for that start signal before it will send a row. We'll need to design a dont-start signal, so that it can get a row without sending headers. On Sun, Sep 27, 2009 at 12:06 PM, Paul Davis paul.joseph.da...@gmail.com wrote: On Sun, Sep 27, 2009 at 1:04 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hey guys, newb question for you: the make script concatenates all the /share/server/*.js scripts into main.js, right? yepper. I'm still trying to figure this stuff out... On Sat, Sep 26, 2009 at 11:35 PM, Zachary Zolton zachary.zol...@gmail.com wrote: I'll start studying the query_server_spec.rb script; I think I might be able to handle this in JavaScript... On Sat, Sep 26, 2009 at 11:22 PM, Chris Anderson jch...@apache.org wrote: On Sat, Sep 26, 2009 at 8:57 PM, Paul Davis paul.joseph.da...@gmail.com wrote: its been awhile since i studied the Erlang side of this, but IIRC, once getRow() returns, the response has started which means that you can't send a redirect. To get it working proper then would require a bit of a patch to wait on starting the response until the first output from the _list function. Yes I think it would be a simple patch, once you understand the entrails of the _list system. You should read the query_server_spec.rb to see what gets sent by the query server on first getRow() call. It may be that this patch can be accomplished just in the javascript side. Chris Paul Davis On Sat, Sep 26, 2009 at 11:39 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hey guys, I need to find a way to do a redirect from a _list function after calling the getRow() function. After looking at render.js for a while I can't see how to solve this without at least adding to the API. Basically, I think that calling getRow() shouldn't cause the view server to send the headers (or awaiting chunks) unless we've already called send() or something like that. That way, we can return from the _list function after iterating to the first row that should redirect. (I'm not sure if this is a breaking change from the current semantics, however...) Would greatly appreciate a little guidance on how to attack this! Cheers, Zach -- Forwarded message -- From: Chris Anderson jch...@apache.org Date: Fri, Sep 25, 2009 at 2:15 PM Subject: Re: Redirect from _list function? To: Zachary Zolton zachary.zol...@gmail.com On Fri, Sep 25, 2009 at 11:01 AM, Zachary Zolton zachary.zol...@gmail.com wrote: So, now I find that using the send() function to perform the redirect doesn't work after the first time I call getRow(). Upon checking out render.js, I see that the getRow() function calls sendStart()—which I haven't quite yet figured out—but I can tell there's something fishy going on there... Would I be correct to assume that the headers are already set after calling getRow()? Yes... The headers are sent when the first getRow is called. Fixing this is definitely something I'd support. On Fri, Sep 25, 2009 at 12:11 PM, Chris Anderson jch...@apache.org wrote: On Fri, Sep 25, 2009 at 8:40 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Okay, I've update this section to differentiate between the 0.9 and 0.10 _list API: http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Sending_a_Redirect Now, I'm feeling that the Other Fun Things section could use a bit of love. Hmm... :^) Thanks for keeping the wiki in mind! On Fri, Sep 25, 2009 at 10:19 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Sweet! I'll try to amend the wiki page for the _list API... On Fri, Sep 25, 2009 at 10:17 AM, Jason Davies ja...@jasondavies.com wrote: On 25 Sep 2009, at 16:16, Zachary Zolton wrote: Thanks for all the help, guys! Shall I delete that JIRA issue? I already did :-) -- Jason Davies www.jasondavies.com
[jira] Updated: (COUCHDB-514) Redirect from _list using view rows
[ 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.
Re: Redirect from _list function?
I've posted a patch from my experiments to the ticket. I'm thinking this'll require some Erlang-fu...? Try not to laugh! ;^) On Mon, Sep 28, 2009 at 1:59 PM, Chris Anderson jch...@apache.org wrote: On Mon, Sep 28, 2009 at 11:34 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Guys, I've started a ticket for this: https://issues.apache.org/jira/browse/COUCHDB-514 I don't know what level of effort would be required to fix this, or if this is even compatible with the current view server protocol. I'm motivated to solve this, but I'd need some coaching from someone with more knowledge of CouchDB view server internals. I'm into getting this to happen too. I barely have time, but I can advise. It wouldn't hurt to post a patch of what you tried, even if it didn;t work, as it will let other know which code you are digging into. Chris Cheers, Zach On Sun, Sep 27, 2009 at 11:35 PM, Chris Anderson jch...@apache.org wrote: On Sun, Sep 27, 2009 at 8:26 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hmm... I can't do anything that doesn't result in a view server timeout. (^_-) Shall I open an issue? I can discuss what I tried, as well... It never hurts to start a ticket. Especially if you have patches. Thinking about it more, it seems like the Erlang side is gonna be looking for that start signal before it will send a row. We'll need to design a dont-start signal, so that it can get a row without sending headers. On Sun, Sep 27, 2009 at 12:06 PM, Paul Davis paul.joseph.da...@gmail.com wrote: On Sun, Sep 27, 2009 at 1:04 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hey guys, newb question for you: the make script concatenates all the /share/server/*.js scripts into main.js, right? yepper. I'm still trying to figure this stuff out... On Sat, Sep 26, 2009 at 11:35 PM, Zachary Zolton zachary.zol...@gmail.com wrote: I'll start studying the query_server_spec.rb script; I think I might be able to handle this in JavaScript... On Sat, Sep 26, 2009 at 11:22 PM, Chris Anderson jch...@apache.org wrote: On Sat, Sep 26, 2009 at 8:57 PM, Paul Davis paul.joseph.da...@gmail.com wrote: its been awhile since i studied the Erlang side of this, but IIRC, once getRow() returns, the response has started which means that you can't send a redirect. To get it working proper then would require a bit of a patch to wait on starting the response until the first output from the _list function. Yes I think it would be a simple patch, once you understand the entrails of the _list system. You should read the query_server_spec.rb to see what gets sent by the query server on first getRow() call. It may be that this patch can be accomplished just in the javascript side. Chris Paul Davis On Sat, Sep 26, 2009 at 11:39 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hey guys, I need to find a way to do a redirect from a _list function after calling the getRow() function. After looking at render.js for a while I can't see how to solve this without at least adding to the API. Basically, I think that calling getRow() shouldn't cause the view server to send the headers (or awaiting chunks) unless we've already called send() or something like that. That way, we can return from the _list function after iterating to the first row that should redirect. (I'm not sure if this is a breaking change from the current semantics, however...) Would greatly appreciate a little guidance on how to attack this! Cheers, Zach -- Forwarded message -- From: Chris Anderson jch...@apache.org Date: Fri, Sep 25, 2009 at 2:15 PM Subject: Re: Redirect from _list function? To: Zachary Zolton zachary.zol...@gmail.com On Fri, Sep 25, 2009 at 11:01 AM, Zachary Zolton zachary.zol...@gmail.com wrote: So, now I find that using the send() function to perform the redirect doesn't work after the first time I call getRow(). Upon checking out render.js, I see that the getRow() function calls sendStart()—which I haven't quite yet figured out—but I can tell there's something fishy going on there... Would I be correct to assume that the headers are already set after calling getRow()? Yes... The headers are sent when the first getRow is called. Fixing this is definitely something I'd support. On Fri, Sep 25, 2009 at 12:11 PM, Chris Anderson jch...@apache.org wrote: On Fri, Sep 25, 2009 at 8:40 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Okay, I've update this section to differentiate between the 0.9 and 0.10 _list API: http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Sending_a_Redirect Now, I'm feeling that the Other Fun Things section could use a bit of love. Hmm... :^) Thanks for keeping the wiki in mind! On Fri, Sep 25, 2009 at 10:19 AM, Zachary Zolton zachary.zol...@gmail.com wrote: Sweet! I'll try to amend the wiki page for the _list API... On Fri, Sep 25, 2009 at 10:17 AM, Jason Davies
Almost ready to release 0.10.0
Hey, The prepared release artifacts for 0.10.0 are available here: http://people.apache.org/~nslater/dist/ If you download and run make check it fails. But I don't know how important this is. Before I call a formal vote, could someone like Paul take a look? Thanks, -- Noah Slater, http://tumbolia.org/nslater
Re: Almost ready to release 0.10.0
That is quite doable. I reckon I have an eta of 20-25 minutes before i'm back to !iPhone. Though me or someone else should double check what ended up being required for the oauth and ibrowse imports. If it requires faxing I'm only comitting the check. I think that it didn't but we need to make certain. There was a big thread on it. The only keywords comming to mind are uncertain, uneasy, or similar. First email was from Curt Arnold I do believe. Yay release! On Sep 28, 2009, at 9:03 PM, Noah Slater nsla...@tumbolia.org wrote: 2009/9/29 Paul Joseph Davis paul.joseph.da...@gmail.com: Note to self, I should either look at adding etap to svn or write a test to see if it's available and die gracefully. I'm leaning towards graceful death right now. I am going to be a big pain in the arse and refuse to install this. Could you import a copy into trunk, get it working, and merge to the branch? We could still get this release out tonight... -- Noah Slater, http://tumbolia.org/nslater
Re: Almost ready to release 0.10.0
2009/9/29 Paul Joseph Davis paul.joseph.da...@gmail.com: That is quite doable. I reckon I have an eta of 20-25 minutes before i'm back to !iPhone. Though me or someone else should double check what ended up being required for the oauth and ibrowse imports. If it requires faxing I'm only comitting the check. I think that it didn't but we need to make certain. There was a big thread on it. The only keywords comming to mind are uncertain, uneasy, or similar. First email was from Curt Arnold I do believe. Coolbeans. Once you're done, blog your changeset, twitter your blog post, then post the twitter status as a Facebook link and ping me on IM to let me know. Thanks, -- Noah Slater, http://tumbolia.org/nslater
Re: Almost ready to release 0.10.0
On Mon, Sep 28, 2009 at 9:25 PM, Noah Slater nsla...@tumbolia.org wrote: 2009/9/29 Paul Joseph Davis paul.joseph.da...@gmail.com: That is quite doable. I reckon I have an eta of 20-25 minutes before i'm back to !iPhone. Though me or someone else should double check what ended up being required for the oauth and ibrowse imports. If it requires faxing I'm only comitting the check. I think that it didn't but we need to make certain. There was a big thread on it. The only keywords comming to mind are uncertain, uneasy, or similar. First email was from Curt Arnold I do believe. Coolbeans. Once you're done, blog your changeset, twitter your blog post, then post the twitter status as a Facebook link and ping me on IM to let me know. Thanks, -- Noah Slater, http://tumbolia.org/nslater Rock on. Found the email I was looking for: http://mail-archives.apache.org/mod_mbox/couchdb-dev/200908.mbox/%3ccaadddf0-9375-4288-8ce5-d43646c0b...@jasondavies.com%3e All is well for awesome coding fun tonight. Paul