smashingmagazine / redesign

Reporting bugs and weird issues on the shiny new Smashing Magazine.
https://next.smashingmagazine.com
41 stars 2 forks source link

Internal server error when adding comment #363

Open leoloso opened 6 years ago

leoloso commented 6 years ago

- Do you want to request a feature or report a bug? Bug

- What is the current behavior? 2 problems:

  1. When I add a particular comment, I get an internal server error
  2. The "posting" keeps spinning forever, it doesn't inform the user that there was an error

Check the console in the screenshot:

comment-error

The comment is this one:

Hi Todd, this solution does not remove the need for a server (as Netlify does), but it offloads the traffic from the server to the CDN, for all content (without user state) that has already been generated by some other user browsing the site in the same region. Hence, you will still need to pay for 1 server, but most likely it will be enough, so you will save money if you have a high-traffic website that usually requires 2 or more servers.

And it is faster since you're reducing the latency to fetch data from a CDN (which is near the user) over the server. To test how much of a difference, you can execute the command below 2 times: the first time will be a miss from CloudFront, and the 2nd will be a hit, and then calculate the time difference (you can change the value of param "tp" randomly to get a miss again):

curl -o /dev/null -s -w %{time_total} "https://content.getpop.org/en/?output=json&&tp=1000"

The PoP website is hosted in US North Virginia, and I'm currently in London. When I execute this command, the first time I get the response in 1.693777 sec, and the 2nd time in 0.659450 sec, so it's shaving a full 1 second, per request.

indysigner commented 6 years ago

Yeah, having the same issue with this particular comment... please have a look @biilmann @pukhalski

The article is: https://www.smashingmagazine.com/2018/02/dynamic-website-static-content-cdn/

and I'm getting an errror 500 when trying to post this comment. Curly quotes or html quotes didn’t help either.

leoloso commented 6 years ago

The issue is the "/", replacing with "\/" did work.

This fails:

curl -o /dev/null -s -w %{time_total} "https://content.getpop.org/en/?output=json&tp=RANDOM_NUMBER_HERE"

This works:

curl -o \/dev\/null -s -w %{time_total} "https:\/\/content.getpop.org\/en\/?output=json&tp=RANDOM_NUMBER_HERE"
indysigner commented 6 years ago

Cool, we’ll have Ilya looking into this soon!

leoloso commented 6 years ago

I added a comment on Smashing the other day, and this error is still happening. Then I had to escape the URL, adding "\" before each "/", making the URL look very ugly and not clickable (the link is never added).

I wonder if this is happening to everyone? If that's the case, you may currently have less comments than could be, from people adding URLs in their comments, failing, and then giving up...