Nasty BUG! 5000 lost comments
Back in October I introduced some new cool features to this blog. Little did I know that I was also introducing a bug that is amazingly difficult to detect. See, if thing work, people tend to not notice that there are issues.
Things did work. In fact, they worked very well, and I didn't give it a moment's notice!
Until few days back I was adding a little enhancement that will automatically count the number of comments and their types and stores them. So whenever I query for them, they're already ready. But the numbers simply didn't add up!
I was counting 38 comments in my new code, but only seeing 12 on the article. It was surreal! At first you will suspect the new code. Of course I must have screwed something up over there. I checked, double and triple checked and the code was just fine!
I went into the database and started counting manually. To my surprise, my new code is actually working perfectly well! No issues what so ever.
I went back to my old code, and found the weirdest thing ever. The code was right, it was totally right! So what the heck is wrong!
I decided to look into the results being returned from my old code and sure enough there was a discrepancy! The comments were just not coming back! The weirdest thing ever!
I tried to fix it for a little bit and decided to just ditch it, and rewrite it from scratch. The new procedure worked perfectly well, it was fast, and most importantly, ACCURATE!
I guess I was in a hurry or something that I didn't test my old code very well. Ended up eating at least 5000 of your valuable comments! So, I'm really sorry for that!
All is well now :)