얼마 전, Discourse-Automation에서 채팅 메시지를 정기적으로 보내지 못하는 문제를 겪었습니다. 우리는 이를 사용하여 채팅 채널에 주간 뉴스를 보내고 있습니다. /logs를 확인해 보니 권한 문제로 인해 채팅 메시지 전송이 실패하고 있음을 발견했습니다.
discourse automation에 설정된 발신자는 관리자가 설정한 것이므로 채널의 권한 설정을 단순히 무시해야 한다고 생각합니다. 실제로 저는 메시징 사용자로서 DiscoBot을 사용하고 있습니다. DiscoBot은 채널에 바인딩된 카테고리에서 비활성 상태였기 때문에(물론) 자동으로 채널에서 제거되었고, 따라서 우리가 설정한 예약된 채팅 메시지는 전달할 수 없게 되었습니다.
잘 모르겠지만, 이건 #contribute:bug인 것 같습니다.
[discourse-automation] Chat message failed to send:
[1/25] [policy] 'no_silenced_user' ✅
[2/25] [contract] 'default' ✅
[3/25] [model] 'channel' ✅
[4/25] [policy] 'allowed_to_join_channel' ✅
[5/25] [policy] 'allowed_to_create_message_in_channel' ✅
[6/25] [step] 'enforce_system_membership' ✅
[7/25] [model] 'channel_membership' ❌
[8/25] [model] 'reply'
[9/25] [policy] 'ensure_reply_consistency'
[10/25] [model] 'thread'
[11/25] [policy] 'ensure_valid_thread_for_channel'
[12/25] [policy] 'ensure_thread_matches_parent'
[13/25] [model] 'uploads'
[14/25] [model] 'message'
[15/25] [transaction]
[16/25] [step] 'save_message'
[17/25] [step] 'delete_drafts'
[18/25] [step] 'post_process_thread'
[19/25] [step] 'create_webhook_event'
[20/25] [step] 'update_channel_last_message'
[21/25] [step] 'update_membership_last_read'
[22/25] [step] 'process_direct_message_channel'
[23/25] [step] 'publish_new_thread'
[24/25] [step] 'publish_new_message_events'
[25/25] [step] 'publish_user_tracking_state'
/var/www/discourse/plugins/chat/app/services/service/base.rb:143:in `call': Model not found (ArgumentError)
raise ArgumentError, "Model not found" if !optional && context[name].blank?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from /var/www/discourse/plugins/chat/app/services/service/base.rb:368:in `block in run!'
from /var/www/discourse/plugins/chat/app/services/service/base.rb:368:in `each'
from /var/www/discourse/plugins/chat/app/services/service/base.rb:368:in `run!'
from /var/www/discourse/plugins/chat/app/services/service/base.rb:361:in `run'
from <internal:kernel>:90:in `tap'
from /var/www/discourse/plugins/chat/app/services/service/base.rb:229:in `call'
from /var/www/discourse/plugins/chat/plugin.rb:451:in `block (3 levels) in activate!'
from /var/www/discourse/plugins/discourse-automation/app/models/discourse_automation/automation.rb:131:in `trigger!'
from /var/www/discourse/plugins/discourse-automation/app/controllers/discourse_automation/automatio...