Live data from Hacker News

Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

getmogochat.com

51–60 of 71 posts

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#51
post #45

Earlier quoted context omitted.

Authentication has to be done again over websockets - on every connect and reconnect. That means it is going to make the app resource hungry. Right, except that WebSockets only connect once in normal operation. You'd be surprised how resource hungry WebSockets aren't when compared to constant HTTP connections. Waiting 2.5 seconds for messages to arrive to all clients feels a little imperfect.

I live in a country where latency for websockets is 300-400ms for most hosting services (US/Europe). And the most common internet connection speed 512kbps. Websockets disconnects for me frequently. So during reconnection, I'll have to reauth in my case.

Well it isn't difficult to detect that case and drop back to polling (which should have the exact same latency anyway). Aiming for lowest common denominator in this stuff seems unwise.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#52
post #6

This is cool, and as a heavy IRC user, I'm eager to find a solution that can replace self-hosted IRSSI+ZNC entirely, without compromising security. Don't reinvent the protocol, reinvent the UI.

Why irssi+znc? Why not just run irssi on the box you run znc on (inside screen or tmux)?

Because with ZNC it's possible to connect from multiple clients, get the full message backlog on every device, push notifications, iOS/Android apps. You could use an ssh client on your phone and reattach to the screen/tmux session but it's just not that comfortable.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#53
post #15

I would like to see a credible open source alternative to Campfire, etc, so this is nice work. But if it's an Ember app, why don't the different rooms present as different URLs?

When URLs change the message pollers also will be destroyed and reinitialized. That would be a problem. IMHO, chat apps usually push the limits of any frontend framework.

No, you're doing it wrong. Apart from your controllers being long-lived and persist between routes, you're usually interacting with the data store, which caches and keeps references to records. Just make sure you're pushing data into the store instead of making requests or whatever. Also, remember the Run Loop.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#54
post #15

I would like to see a credible open source alternative to Campfire, etc, so this is nice work. But if it's an Ember app, why don't the different rooms present as different URLs?

Check out https://github.com/sdelements/lets-chat, it does exactly that.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#56

Earlier quoted context omitted.

Just to clarify: var t = document.createTextNode(msg); content.appendChild(t); That code sanitises all possible content in msg. I don't need to list out HTML tags, script/style tags, do special case for unicode exploits, etc. You need to list what variables are "unsafe", but you don't need to list out the ways they might be unsafe. If it's got the potential to be unsafe, assume it's completely unsafe in every conceiv…

Ya, but if they built it so msg=' msg ' that would remove the bold, no? So it is a bit more complex than that if they want to enable user markup. https://code.google.com/p/pagedown/source/browse/Markdown.Sa... https://code.google.com/p/pagedown/wiki/PageDown

I'm not even a front end guy but I'm pretty sure the field they are adding the user message to should handle the style, not the user message.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#57
post #51

Earlier quoted context omitted.

I live in a country where latency for websockets is 300-400ms for most hosting services (US/Europe). And the most common internet connection speed 512kbps. Websockets disconnects for me frequently. So during reconnection, I'll have to reauth in my case.

Well it isn't difficult to detect that case and drop back to polling (which should have the exact same latency anyway). Aiming for lowest common denominator in this stuff seems unwise.

Totally agree. That's the right way to do it.

MogoChat is right now a one-man project, so supporting websockets and then polling seemed tedious, especially with something like Faye or SocketIO missing in Elixir. Phoenix Framework will soon have a high level abstraction over websockets (with Faye-like features). Once that's in, I'll be able to use it.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#58

Earlier quoted context omitted.

Just to clarify: var t = document.createTextNode(msg); content.appendChild(t); That code sanitises all possible content in msg. I don't need to list out HTML tags, script/style tags, do special case for unicode exploits, etc. You need to list what variables are "unsafe", but you don't need to list out the ways they might be unsafe. If it's got the potential to be unsafe, assume it's completely unsafe in every conceiv…

Ya, but if they built it so msg=' msg ' that would remove the bold, no? So it is a bit more complex than that if they want to enable user markup. https://code.google.com/p/pagedown/source/browse/Markdown.Sa... https://code.google.com/p/pagedown/wiki/PageDown

If you want to enable user markup, then build a simple parser, and use that to generate the correct styling you require.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#59
post #41

Earlier quoted context omitted.

Just to clarify: var t = document.createTextNode(msg); content.appendChild(t); That code sanitises all possible content in msg. I don't need to list out HTML tags, script/style tags, do special case for unicode exploits, etc. You need to list what variables are "unsafe", but you don't need to list out the ways they might be unsafe. If it's got the potential to be unsafe, assume it's completely unsafe in every conceiv…

InnerHTML should be removed from browsers. While it's still the fastest method for changing the page DOM it shouldn't be. When used outside of user inputted scenarios it's fine.

It's still absolutely ugly code. And in many cases direct DOM manipulation beats it in terms of speed.

Re: Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js

#60

Earlier quoted context omitted.

Ya, but if they built it so msg=' msg ' that would remove the bold, no? So it is a bit more complex than that if they want to enable user markup. https://code.google.com/p/pagedown/source/browse/Markdown.Sa... https://code.google.com/p/pagedown/wiki/PageDown

I'm not even a front end guy but I'm pretty sure the field they are adding the user message to should handle the style, not the user message.

If one uses common choices [e.g. Markdown] that isn't how the parsers are designed.

It is [message] -> [parse] -> [sanitize], generally.

Post reply on HN