Our bot is running on a Drupal 7 site and it works great, but for some reason it seems to periodically 'forget' factoids, almost as though there's some kind of limit to the number of factoids available or some kind of clean-up of unused ones. Anyone else experiencing this? Can't find any settings of other reports, but it feels like a bug...

Comments

Morbus Iff’s picture

Status: Active » Postponed (maintainer needs more info)

Are you sure it's actually forgetting them versus someone actually removing them or resetting them?

There's no limit or pruning feature of the bot code, so for it to "forget" factoids means for MySQL to literally be losing data from its tables.

greg.harvey’s picture

Wow, OK. Yes, we're quite sure it is forgetting. The bot is only accessible to about 8 people. One example (which has happened twice now) is we set our phone extensions, e.g. ...

gregharvey phone is <reply>2617784

Firstly, there would be no reason for someone to actually remove/reset that, secondly, the bot is also logging in all channels it is active in and I see nowhere in the logs where anyone did that. Nevertheless, that factoid is gone and was definitely there. I can probably prove it with back-ups, if necessary.

Very strange indeed! It seems somehow MySQL is genuinely and literally losing data from tables. Question is how? =/

greg.harvey’s picture

Status: Postponed (maintainer needs more info) » Active

One thought, we do mess about sometimes, e.g. someone might set something silly, e.g.

gregharvey is <reply>Smells of old garlic.

(Yes, we're children!)

The only way I could think this *might* be happening is something like that is somehow causing the deletion of the factoid "gregharvey phone". Could that happen? Thinking about it, the last two phone numbers to get forgotten happened straight after myself and a colleague had been messing about and doing just that sort of thing, then suddenly the bot didn't know our phone numbers any more. Perhaps factoid resetting is only acting based on the first word in the string?

Morbus Iff’s picture

Hrm... spaces in a factoid might very well be it, but I'd have to look at the code, and I'm in the midst of feeding children at the moment ;)

Morbus Iff’s picture

Yep, that's definitely it. bot_factoid_delete() uses a LIKE in the query (why, I don't recall; will have to re-evaluate my use
cases), and that would cause a resetting (and potentially a setting) of "gregharvey" to delete "gregharvey phone" as well.

Still making food for the children, but it's definitely a bug, and definitely needs to be fixed. I'll look later.

Morbus Iff’s picture

Status: Active » Fixed
greg.harvey’s picture

Wow, thanks for the quick fix! Much appreciated. =)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.