Cakeday: bloqueos en la llamada a la API para usuarios no autenticados

Hola,

Actualmente estoy recibiendo este error si activo cakeday y el usuario no ha iniciado sesión:


    Message

    NoMethodError (undefined method user_option' for nil:NilClass) (eval):86:in _fast_attributes’
    app/serializers/post_stream_serializer_mixin.rb:54:in block in posts' app/serializers/post_stream_serializer_mixin.rb:47:in map’
    app/serializers/post_stream_serializer_mixin.rb:47:in posts' app/serializers/post_stream_serializer_mixin.rb:18:in post_stream’
    (eval):3:in _fast_attributes' app/controllers/application_controller.rb:545:in render_json_dump’
    app/controllers/topics_controller.rb:1249:in block (2 levels) in perform_show_response' app/controllers/topics_controller.rb:1239:in perform_show_response’
    app/controllers/topics_controller.rb:187:in show' app/controllers/application_controller.rb:414:in block in with_resolved_locale’
    app/controllers/application_controller.rb:414:in with_resolved_locale' lib/middleware/omniauth_bypass_middleware.rb:74:in call’
    lib/middleware/content_security_policy/middleware.rb:12:in call' lib/middleware/anonymous_cache.rb:367: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/discourse-cakeday/plugin.rb:68:in block (2 levels) in activate!' (eval):86:in _fast_attributes’
    /nix/store/jlw6xd3hvk4jdrp1aiiap9h62y13c7dj-ruby3.2.2-active_model_serializers-0.8.4/lib/ruby/gems/3.2.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:468:in rescue in attributes' /nix/store/jlw6xd3hvk4jdrp1aiiap9h62y13c7dj-ruby3.2.2-active_model_serializers-0.8.4/lib/ruby/gems/3.2.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:455:in attributes’
    /nix/store/jlw6xd3hvk4jdrp1aiiap9h62y13c7dj-ruby3.2.2-active_model_serializers-0.8.4/lib/ruby/gems/3.2.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in _serializable_hash' /nix/store/jlw6xd3hvk4jdrp1aiiap9h62y13c7dj-ruby3.2.2-active_model_serializers-0.8.4/lib/ruby/gems/3.2.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in serializable_hash’
    /nix/store/jlw6xd3hvk4jdrp1aiiap9h62y13c7dj-ruby3.2.2-active_model_serializers-0.8.4/lib/ruby/gems/3.2.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:347:in as_json' app/serializers/post_stream_serializer_mixin.rb:54:in block in posts’
    /nix/store/k92bjvqvynnbrvdd26vfg7cf5vh3dxhj-ruby3.2.2-activerecord-7.0.4.3/lib/ruby/gems/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/relation/delegation.rb:88:in each' /nix/store/k92bjvqvynnbrvdd26vfg7cf5vh3dxhj-ruby3.2.2-activerecord-7.0.4.3/lib/ruby/gems/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/relation/delegation.rb:88:in each’

    Env

    HTTP HOSTS: forum.miki.community

Parece que causa una respuesta 500 y una página de error “Oops” :confused:

Hola MTRNord :slight_smile:

No puedo replicar tu problema. ¿Puedes describir los pasos exactos para reproducirlo?

En realidad, ya lo resolví y no había tenido tiempo de actualizar esto, ¡lo siento! El problema era una incompatibilidad de versiones. :slight_smile: Actualizar a la versión 3.2.0.beta1 hizo que funcionara correctamente.

2 Me gusta

Este tema se cerró automáticamente después de 16 horas. Ya no se permiten nuevas respuestas.