Renaming discobot causes it to break

AI 生成的摘要

Renaming Discobot causes it to break. blake reported this issue and provided screenshots of the errors. tgxworld explained that the issue is due to caching, which requires a rebuild to resolve. However, blake found that even after a rebuild, the bot still doesn’t work properly in certain scenarios, such as responding to mentions in a topic or a PM to oneself. tgxworld has since fixed the issue with a commit to the Discourse repository.

I just tried renaming @discobot locally and on a live site and doing so causes it to not function properly.

See the screen shot below to see what happens after I renamed it to @pizzabot:

4 个赞

We’re caching it so it’ll take a rebuild for it to work.

I’ll look into maybe adding an AR callback to burst the cache when the username changes.

10 个赞

Okay I can confirm that doing a rebuild after a rename causes it to work again. But unless I’m doing something wrong I still think there are issues after a rename.

If I send a PM directly to my renamed bot it works great. But if I respond in a topic or in a PM to just myself and mention the bot it doesn’t work:

Message to myself:

Responding in a topic:

PM to my renamed bot (this works)

2 个赞

Fixed in

https://github.com/discourse/discourse/commit/7028bdceed47cfa02faed55d10d25298f16acca4

7 个赞