That Time I Broke Marvel.com
• ~500 words • 2 minute read
Amazon recently had a bit of a hiccup with their S3 service. The key bit from their statement reads:
Unfortunately, one of the inputs to the command was entered incorrectly and a larger set of servers was removed than intended.
Ouch! I feel bad for the person that made that error. I can say I've never made a blunder that affected that many people, thankfully.
Actually, I take that back. I may have done that once, albeit very briefly.
I have a popular open-source project called Konami-JS that's been around for nearly a decade. At one point in its incarnation it was suggested you could link directly to the raw JavaScript file hosted in GitHub and use it like a CDN. There's nothing to stop you from continuing to do that but I've since rescinded that recommendation.
Why? Well, in early 2010 a little birdie pointed out to me that my code was being used at Marvel.com:
@georgeMandis I wonder what would happen if you entered the konami code on the front page of Marvel.com?
— Peter Olson (@Dethtron5000) January 29, 2010
I thought that was so cool! To see my silly easter-egg project in-use on a huge site like that blew my mind. In the moment I was inspired to make a tiny update to the code, though I can't recall what. Looking at the commit history I think it may have come around February 4th, 2010, while trying to fix the code so multiple instances of the easter egg could work on the same page.
Recklessly I pushed an update to GitHub without really testing it or thinking it through. Very shortly after that — thankfully, as it turns out — I went to check that the easter-egg was still in-effect on Marvel.com. I noticed the layout looked broken and mangled.
"Strange," I thought. Reloading the page did not good. "Someone must have broken the site with an update," I said, thinking it was strange that such a bug would coincide with my own updates to Konami-JS.
Oh shit. I put it together very quickly and took a peek at the source code to see if they were linking directly to the raw file. Sure enough, they were.
I quickly tracked down the bug in my own code, made the fix and pushed the update through. I was relieved to find Marvel.com back to how I'd expected it to look, and the easter-egg still showing the weird little Deadpool gopher guy when entered correctly.
It was an early lesson in the potential follies of everyone relying on the same host or resource across the internet. The web is heavily reliant on Amazon Web Services, S3 and CDNs. Occasionally when they go down or get borked we get a reminder of this.
Six months later I was a little relieved to see that Newsweek had gone the route of self-hosting their wonderful Konami-JS easter-egg.