holmesal / shortwave

2 stars 0 forks source link

Disallow certain characters in channel names #126

Closed holmesal closed 10 years ago

holmesal commented 10 years ago

Firebase doesn't allow certain characters in channel names, so we can't allow them either.

The list of characters not allowed is at the bottom of this page

holmesal commented 10 years ago

Weirdly, firebase seems okay with keys like weird key!. Investigate this.

matthewkulp commented 10 years ago

Not allowed: . $ [ ] / or ASCII control characters 0-31 or 127

Wild idea.. some day, would we want to intercept these unallowed characters and interpret them as allowable characters in firebase?

For example: User enters 'CashMoney$$$' It goes into firebase as 'CashMoneyåÅåÅåÅ' (åÅ is some combination of characters that never will get used together) When another user fetches it from Firebase the characters are interpreted back as $$$

Surely there is a less hack-y way. In the meanwhile, I can make a screen that notifies users of unallowable characters.

holmesal commented 10 years ago

Depends - 

For characters like $, you'd probably be fine.

Characters like / or # or . break urls, though, so they wouldn't work. Same with spaces

In terms of ui, I was thinking we would just backspace after they type an unallowed character, and show them a quick message - no reason to have them study up. Experience is normal unless they enter a bad character.

Is that watertight?

On Mon, Jul 28, 2014 at 11:07 AM, Matthew Kulp notifications@github.com wrote:

Not allowed: . $ [ ] / or ASCII control characters 0-31 or 127 Wild idea.. some day, would we want to intercept these unallowed characters and interpret them as allowable characters in firebase? For example: User enters 'CashMoney$$$' It goes into firebase as 'CashMoneyåÅåÅåÅ' (åÅ is some combination of characters that never will get used together) When another user fetches it from Firebase the characters are interpreted back as $$$

Surely there is a less hack-y way. In the meanwhile, I can make a screen that notifies users of unallowable characters.

Reply to this email directly or view it on GitHub: https://github.com/holmesal/shortwave/issues/126#issuecomment-50375344

matthewkulp commented 10 years ago

I love that idea. I'll mock that up.

holmesal commented 10 years ago

We talked yesterday about replacing spaces with dashes and saying "is this ok" after the user hits "create", instead of doing it inline.

The version I built yesterday does the replace-as-you-type, and it's not bad, but if there's still interest around this I'd love to see mocks for the above option.

Something to think about: if I type some channel, you would need to be actually checking the existence of some-channel, but not showing me that that's what you're doing. Then, when I hit enter, you would need to say "how about some-channel?".

Feels kinda messy to me, but if we find that the replace-as-you-type really bugs us, let's do it.

holmesal commented 10 years ago

Disallowing certain characters is implemented on the web version. @DogsForArms is this in the latest release?

Also, firebase locations are case-sensitive. My feeling is that we should lowercase all channel names. What say you all?

DogsForArms commented 10 years ago

Ok sounds good; I think readinganentirelowercasesentanceishard, but the dashes for spaces works... I just hope they don't think they have to hit the dash button.

This is implemented in the latest build. I protect against ".$[]/" and space.

holmesal commented 10 years ago

yep, they should be able to hit the space button naturally and just have it replaced by a dash

On Thu, Aug 14, 2014 at 8:34 PM, Ethan Sherr notifications@github.com wrote:

Ok sounds good; I think readinganentirelowercasesentanceishard, but the dashes for spaces works... I just hope they don't think they have to hit the dash button.

This is implemented in the latest build. I protect against ".$[]/" and space.

— Reply to this email directly or view it on GitHub https://github.com/holmesal/shortwave/issues/126#issuecomment-52271390.

Alonso Holmes holmesal@bu.edu

DogsForArms commented 10 years ago

all disallowed characters: ["$","[","]","/", ".", "#"] and space

DogsForArms commented 10 years ago

( Closed? )

holmesal commented 10 years ago

Done on the web for sure, feel free to close this if its good on mobile.- alonso

On Mon, Aug 25, 2014 at 12:35 PM, Ethan Sherr notifications@github.com wrote:

( Closed? )

Reply to this email directly or view it on GitHub: https://github.com/holmesal/shortwave/issues/126#issuecomment-53296973

holmesal commented 10 years ago

(closing)