It seems that there has been an issue with posting comments on my blog. When posting a comment people would be greeted with the message "Sorry, the following error occurred while processing your comment: There was an error in the callback."
I had received a couple of reports regarding this but could never seem to replicate it. Well, it turns out the bug only happened to users who are not signed into my blog – which would be everyone but myself. I discovered this by accident after forgetting to sign into my blog and posting a test comment after getting a message regarding the error (thanks Aunt Pat!). All I could mange to to say to myself was: Duh….
After a couple of other tests verifying the bug existed, I set about trying to resolve the cause. The first place I started was in the extensions I use in the commenting system to help prevent spammers from littering the comments with useless comments and links. I disabled the Askimet and reCaptcha extensions and lo and behold, the bug went away! My gut instinct seemed to have paid off – for the moment.
At this point I decided to leave the extensions disabled, enable comment moderation, and not pursue the issue any further. I really hate forcing users to enter a CAPTCHA to post a comment. Entering a CAPTCHA is, at least in my mind, a form of punishment inflicted on the user by spammers and overly uptight sysadmins and being it was the wee hours of the morning, I decided to grab a quick round of TF2 and then go hit the sack. All was well in Well Rounded Geek land.
Upon waking the next morning, I engaged in my usual ritual of checking my email while slurping on a Red Bull and rubbing the sleep out of my eyes. My eyes rapidly opened as I was stunned to find 33 notification emails from my blog letting me know a comment had been posted. 33 comments all while I was lost in slumber! WOOHOO! People love me! Now wide awake, I logged into my blog to find that every single comment was spam.
Bloody hell! Mo&%er fu^@*!ng spammers!
After spending 20 minutes updating the filters on my blog and deciding that enough was enough, I hit Google. I had to find out what was causing the callback errors and doing a Google search first is a lot faster than firing up a full debugging session.
Luckily for me I almost immediately came across a forum posting describing the same issue I was having. Continuing to read down the thread, lo and behold I came across the exact problem I was having. And the best part: there was a fix posted by Andrea Dottor.
I immediately backed up copies of the offending files and implemented the fix. BAM! No more callback errors with all spam filters and services enabled. VICTORY! SUCK IT SPAMMERS!
There bug? It turned out to be a rather pedestrian mistake: trying to return the wrong type of object when calling the BlogService.LoadFromDataStore function inside the ReCaptcha component. I have posted the changed source code here:
All credit goes to Andrea Dottor for finding the bug and posting the solution.
So, dear readers and commenters, I apologize for the fact that you have to input the CAPTCHAs and jump through the hoop to post here. I don’t want you to have to do it, but the bloody spammers leave me no choice…