不久前,我们在 Discourse-Automation 中遇到了一个问题,导致无法定期发送聊天消息。我们使用它来在聊天频道中发送每周新闻。我在 /logs 中发现,聊天消息因权限问题发送失败。
我认为,在 Discourse Automation 中配置的发送者应直接忽略频道的权限设置,因为这是由管理员设定的。事实上,我使用的是 DiscoBot 作为消息发送用户。由于 DiscoBot 未处于与该频道绑定的分类中——当然——它被自动从频道中移除,因此我们设置的定时聊天消息无法送达。
我不确定,但我觉得这属于 #contribute:bug。
[discourse-automation] 聊天消息发送失败:
[1/25] [策略] 'no_silenced_user' ✅
[2/25] [契约] 'default' ✅
[3/25] [模型] 'channel' ✅
[4/25] [策略] 'allowed_to_join_channel' ✅
[5/25] [策略] 'allowed_to_create_message_in_channel' ✅
[6/25] [步骤] 'enforce_system_membership' ✅
[7/25] [模型] 'channel_membership' ❌
[8/25] [模型] 'reply'
[9/25] [策略] 'ensure_reply_consistency'
[10/25] [模型] 'thread'
[11/25] [策略] 'ensure_valid_thread_for_channel'
[12/25] [策略] 'ensure_thread_matches_parent'
[13/25] [模型] 'uploads'
[14/25] [模型] 'message'
[15/25] [事务]
[16/25] [步骤] 'save_message'
[17/25] [步骤] 'delete_drafts'
[18/25] [步骤] 'post_process_thread'
[19/25] [步骤] 'create_webhook_event'
[20/25] [步骤] 'update_channel_last_message'
[21/25] [步骤] 'update_membership_last_read'
[22/25] [步骤] 'process_direct_message_channel'
[23/25] [步骤] 'publish_new_thread'
[24/25] [步骤] 'publish_new_message_events'
[25/25] [步骤] 'publish_user_tracking_state'
/var/www/discourse/plugins/chat/app/services/service/base.rb:143:in `call': 模型未找到 (ArgumentError)
raise ArgumentError, "模型未找到" if !optional && context[name].blank?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
从 /var/www/discourse/plugins/chat/app/services/service/base.rb:368:in `block in run!'
从 /var/www/discourse/plugins/chat/app/services/service/base.rb:368:in `each'
从 /var/www/discourse/plugins/chat/app/services/service/base.rb:368:in `run!'
从 /var/www/discourse/plugins/chat/app/services/service/base.rb:361:in `run'
从 <internal:kernel>:90:in `tap'
从 /var/www/discourse/plugins/chat/app/services/service/base.rb:229:in `call'
从 /var/www/discourse/plugins/chat/plugin.rb:451:in `block (3 levels) in activate!'
从 /var/www/discourse/plugins/discourse-automation/app/models/discourse_automation/automation.rb:131:in `trigger!'
从 /var/www/discourse/plugins/discourse-automation/app/controllers/discourse_automation/automatio...