Chewchat Database Crisis

Aargh! Crisis to deal with! But it took me about 2 minutes to get to the root of the problem (and 100 seconds of that was finding the right file to look in) while everyone else had been staring at it for ages – nice to be reminded that I do have a use once in a while.

The problem was on Chewchat – people were receiving the wrong messages! Aargh – our worst nightmare! Turns out, Guy who wrote the code made it insert each new message into the database, and then retrieve the message by selecting the most recently inserted item in the database – fine while you only have a few entries going in, but when (as now) the site goes ballistic and loads of people are sending messages, the last message inserted is not guaranteed to be the message inserted by the current process.

Got Tim fixing it now. Thanks god.