Fixed  Using Spam Cleaner run into mysqli duplicate key issue



I just imported an SFM board into XenForo, rebuild the caches, browsed around and it's all good. Until we noticed a spam user with 250+ spam messages. So the request was to remove the user's content and ban the user.

While doing so, I noticed within 10 seconds that it was checking for the IP as well, something I didn't intend to do. So I clicked the cancel button. Went to the URL and pressed enter to reload the page.

I clicked on Spam in a post again, unchecked 'check for ip', and run it. About 10 seconds in I gave the following error: shot 2011-02-23 at 3.27.00 AM.png

After quick investigation it appears the posts are indeed all gone. (so I also can't reproduce it).


XenForo developer
Staff member
I think this must've been down to the transaction taking a while and potentially getting values that were consistent based on snapshots, but became inconsistent by the time the inserts happened. There is plenty of code that tries to prevent duplicate inserts here.

I've moved the banning code to a slightly different position, so that may help.