Review queue can't render chat message flagged by AI

,

Hi, really enjoying these AI modules, thanks a lot for the work put in!

I’ve configured the toxicity module with the detoxify service running locally, and its working for posts, but for DM’s, it will flag bad ones successfully, however when I visit the review/moderation page (the summart “all” page or the “flagged item” page for these messages) I get:

Server Error
while trying to load /review?priority=low&status=pending&sort_order=score
Error code: 500 Internal Server Error

That’s only for comments that get flagged - for posts/topics or mail, I can select the the “Flagged Item” notification and the review/moderation page for that item will display properly.

I’m not sure if this is an edge case or related to the recent upgrade to Discourse (I’m on 3.1.0.beta5 which came out quite recently)

I see two events in the logs when I trigger the 500 error. It looks like there’s a problem fetching the message.

Error in the logs:

Message

ArgumentError (wrong number of arguments (given 0, expected 1))
(eval):7:in `_fast_attributes'
lib/freedom_patches/ams_include_without_root.rb:57:in `include!'
app/controllers/reviewables_controller.rb:55:in `block in index'
app/controllers/reviewables_controller.rb:50:in `map!'
app/controllers/reviewables_controller.rb:50:in `index'
app/controllers/application_controller.rb:418:in `block in with_resolved_locale'
app/controllers/application_controller.rb:418:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:369:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

Backtrace

plugins/chat/app/models/chat/direct_message_channel.rb:19:in `title'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:99:in `block in attribute'
(eval):7:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:456:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer/associations.rb:200:in `serialize'
lib/freedom_patches/ams_include_without_root.rb:57:in `include!'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:368:in `block in include_associations!'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:367:in `each_key'

Cheers,
Fraser

5 Likes

Hi @fracool,

I just pushed a fix for this bug:

Everything should work fine after you rebuild your site.

Thanks for letting us know!

8 Likes

Much appreciated, that’s working now :smiley:

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.