codewars / codewars.com

Issue tracker for Codewars
https://www.codewars.com
BSD 2-Clause "Simplified" License
2.09k stars 218 forks source link

Extra space in emailed links #40

Closed jolaf closed 9 years ago

jolaf commented 9 years ago

When I receive an email about a new comment in a discourse I participate in, it looks like this:

SomeUser replied to your discourse on the "Some Kata" kata. The comment reads:

Some text.

View in conversation

"View in conversation" is a link. In most cases this link contains an error - extra space somewhere in the middle of a link, that causes a 404 error when link is clicked. Here are couple of real examples, copied from real mails:

http://mandrillapp.com/track/click/12712279/www.codewars.com?p=eyJzIjoiVFUzNzBXM3p6Zk5yZ0hoZloxRHRrQ2pTeUVjIiwidiI6MSwicCI6IntcInVcIjoxMjcxMjI3OSxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvd3d3LmNvZGV3YXJzLmNvbVxcXC9rYXRhXFxcL3RoZS1lIG5pZ21hLW1hY2hpbmUtcGFydC00LWEtcm90b3ItcGFydC1paVxcXC9kaXNjdXNzP3V0bV9jYW1wYWlnbj1jb2RlX2NoYWxsZW5nZV9jb21tZW50X3JlcGx5JnV0bV9tZWRpdW09ZW1haWwmdXRtX3NvdXJjZT1ub3RpZmljYXRpb25zIzU1MmUyNDBkMzk1Y2QwYTM1MTAwMDAzNFwiLFwiaWRcIjpcImY4N2ZhZDY0MWRmNzRjZDc5NGQ0ZjRjZWNhYWRmODJmXCIsXCJ1cmxfaWRzXCI6W1wiZjYyN2JmNDZjOGYyMzkzNWU3ODNmYmFlNzQ4NzlkNjc0NThiYzRmYVwiXX0ifQ

get redirected to:

http://www.codewars.com/kata/the-e%20nigma-machine-part-4-a-rotor-part-ii/discuss?utm_campaign=code_challenge_comment_reply&utm_medium=email&utm_source=notifications#552e240d395cd0a351000034

Note the %20 after "http://www.codewars.com/kata/the-e"

Another example:

http://mandrillapp.com/track/click/12712279/www.codewars.com?p=eyJzIjoiSmxPd2xPYnlmV0JNNUZxM2t6LTQwRURfd0MwIiwidiI6MSwicCI6IntcInVcIjoxMjcxMjI3OSxcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvd3d3LmNvZGV3YXJzLmNvbVxcXC9rYXRhXFxcL3RoZS1lbmlnbWEtbWFjaGkgbmUtcGFydC0zLXRoZS1yZWZsZWN0b3JcXFwvZGlzY3Vzcz91dG1fY2FtcGFpZ249Y29kZV9jaGFsbGVuZ2VfY29tbWVudF9yZXBseSZ1dG1fbWVkaXVtPWVtYWlsJnV0bV9zb3VyY2U9bm90aWZpY2F0aW9ucyM1NTJlMjQ1YmFiNGExNDRjMjUwMDAwNGJcIixcImlkXCI6XCJiMTFmZDg5NTI3OGU0NjhjOTZmY2YzNzZkNDc1OWI4N1wiLFwidXJsX2lkc1wiOltcImY2MjdiZjQ2YzhmMjM5MzVlNzgzZmJhZTc0ODc5ZDY3NDU4YmM0ZmFcIl19In0

gets redirected to:

http://www.codewars.com/kata/the-enigma-machi%20ne-part-3-the-reflector/discuss?utm_campaign=code_challenge_comment_reply&utm_medium=email&utm_source=notifications#552e245bab4a144c2500004b

Note the %20 after "http://www.codewars.com/kata/the-enigma-machi"

jhoffner commented 9 years ago

This is an odd error that was thought to have been caused by our email provider and fixed, but apparently not. Thanks for letting us know.

jhoffner commented 9 years ago

Looks like Slim is the issue since it is outputting a single line, SMTP requires line breaks when lines are longer than 10000 characters (or something like that).

jhoffner commented 9 years ago

I deployed a fix for this. Please verify that it works the next time you get an email, I was having a hard time reproducing the issue.

jolaf commented 9 years ago

Verification confirmed, I received something like ten emails since the fix was deployed, all the links worked fine.