Closed holmesal closed 10 years ago
So this is only when someone has copied a url into their compose-message-text-field? Sounds good.
Oh wait. it's parsing hubot's non mp4 response. Ok so specifically, something like this?
Person A: "Hubot animate me something" then maybe hubot ~ONLY~ responds to personA "http://someWebUrlPointingToA.gif" then person A (with their own IP) ~ONLY~ changes that url into something more like "http://gifycat.com/#newVersionAsAn.mp4" and person A tells hubot about it, and hubot then responds to the chat with an mp4 for all?
or an edit on the above, only one person delegates parsing hubot's response from a gif to an mp4 via gifycat, not necessarily the sender of the hubot command, but instead, the first person who receives the message from hubot. (person A might have locked their phone)
@DogsForArms it's both - content-parsing with pasted URLs can be moved to the client, but hubot's an interesting edge-case.
Clients should definitely be responsible for their own messages, and I think hubot messages should be "open-season" - any client can convert them. We can use a transaction here.
This isn't a big deal yet, but it's something we'll want to push out an update on iOS around a week or so before we want it to be live.
ok sounds good. not sure if they've fixed transactions on ios yet.
They should, they're just about to hit 100,000 developers :)
WOW
I think there's an even simpler solution here - make the head requests/content-parsing a display problem, not a data problem.
Any client that sees a URL makes a HEAD request to determine the type, and if it's a type that the client recognizes then the client fetches the content and displays it however is necessary. If it's not, it just stays a URL.
So basically all of the messages in firebase would go back to type:text (for now, but let's leave the door open to doing type:join, type:leave, type:poke etc down the road), and every client would individually figure out how to best display any detected URLs.
Yo diggity?
Based con conversation today:
Optimization for parsing / GFYCAT solutions
Pros - no server load Cons - coordination, out of date versions
The server only sees things that clients aren't able to see for themselves.
Pros - no server load Cons - complexity, out-of-date-versions, potential choppy scrolling
Closing this for now, but we'll dig this up down the road when we get the time to do some optimization
Because of #160, we need to move at least gif handling to the client. Let's just move everything (it's really easy).
Here are the steps:
content-type
header you get back, and build+send the message accordingly. list of content types.So it's pretty straightforward, should be doable in a couple of hours on each platform. It does give us a bit more code surface to maintain, but it also takes a significant load off the server and that's something everyone can enjoy