Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Morbus IffAre 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.
Comment #2
greg.harveyWow, 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. ...
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? =/
Comment #3
greg.harveyOne thought, we do mess about sometimes, e.g. someone might set something silly, e.g.
(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?
Comment #4
Morbus IffHrm... 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 ;)
Comment #5
Morbus IffYep, 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.
Comment #6
Morbus IffComment #7
greg.harveyWow, thanks for the quick fix! Much appreciated. =)