couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Farrell <>
Subject Re: Spaces in View Names
Date Thu, 17 Feb 2011 23:20:53 GMT
On Tue, Feb 15, 2011 at 4:22 PM, Benjamin Young <> wrote:
> On 2/14/11 11:50 AM, Gabriel Farrell wrote:
>> If there's a use case for including spaces in view names (I haven't
>> thought of one yet) we could meet that while avoiding whitespace-only
>> names and other tricky issues by trimming leading and trailing spaces
>> before creation.
> True, but you could still have two spaces in a name and that could still
> prove confusing.
> I'd vote for dropping it as an available character for view names (and maybe
> some other spots like filters, etc).
> I can do this easily enough in the UI, but how should we handle things
> "lower down?" By now we've likely got view names floating around installs
> that contain spaces.
> That's the bigger questions here, I think.
> Thoughts?

Agreed, the handling in the core is a bigger issue. It would be odd
for something to be illegal in futon but not in couch.

Are we starting down a slippery slope here? Until now anything valid
in a JSON string was valid as a view name, right? Do we want to start
validating these strings for view names, and possibly add other
validation requirements and other spots for validation (list, show,
etc.) down the road?

>> On Mon, Feb 14, 2011 at 11:10 AM, Jan Lehnardt<>  wrote:
>>> Hi Benjamin,
>>> On 14 Feb 2011, at 16:52, Benjamin Young wrote:
>>>> Hi all,
>>>> It's currently possible to include space characters in View names, so
>>>> your map/reduce URL can (actually) look like this:
>>>> /db/_design/app/_view/
>>>> (there are 5 spaces at the end of that partial "URL")
>>>> Encoded it would look like this:
>>>> /db/_design/app/_view/%20%20%20%20%20
>>>> Needless to say this could be potentially quite confusing--though I
>>>> suppose we could consider it an obfuscation option. :/
>>>> Should this be considered a "bug" and avoided in future views? or just
>>>> considered an option that one should be careful when using?
>>>> This came to my attention as Futon currently adds %20's to the names
>>>> when displayed in dropdowns. Futon2, however, doesn't currently do
>>>> that--making it nearly impossible to click the name of the view above--it
>>>> least looks like a bug in the UI.
>>>> Additionally, when editing documents with a view named with all spaces,
>>>> the keys are displayed as un-viewable whitespace until you edit that chunk.
>>>> In Futon2 it's currently impossible to edit that piece of the document (as
>>>> you can't click it).
>>>> As I'm working on Futon2, I'm wanting to determine what's the best way
>>>> to handle spaces in view names. Should they be removed as an option for that
>>>> portion of the URL going forward? Should Futon2 escape them in any visual
>>>> reference to them (as Futon1 currently does in most cases)?
>>>> Just wanted to get some discussion on this before I picked a way
>>>> forward. :)
>>> Thanks for bringing this up. I think we should not allow spaces in view
>>> names.
>>> Cheers
>>> Jan
>>> --

View raw message