중첩 답변과 게시물 투표 활성화 시 오류 발생

네스트된 답변(nest replies)과 게시물 투표(post voting)를 활성화하고 게시물을 네스트된 답변 보기로 전환하면 500 오류가 발생합니다.

NoMethodError (undefined method 'post_number' for nil) lib/nested_replies/post_tree_serializer.rb:88:in 'NestedReplies::PostTreeSerializer#topic_view_json' lib/nested_replies/post_tree_serializer.rb:2
NoMethodError (undefined method 'post_number' for nil)
lib/nested_replies/post_tree_serializer.rb:88:in 'NestedReplies::PostTreeSerializer#topic_view_json'
lib/nested_replies/post_tree_serializer.rb:20:in 'NestedReplies::PostTreeSerializer#serialize_topic'
app/services/nested_topic/list_roots.rb:124:in 'NestedTopic::ListRoots#enrich_with_topic_metadata'
lib/service/base/step.rb:43:in 'BasicObject#instance_exec'
lib/service/base/step.rb:43:in 'Service::Base::Step#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base/only_if_step.rb:19:in 'block in Service::Base::OnlyIfStep#run_step'
lib/service/base/only_if_step.rb:19:in 'Array#each'
lib/service/base/only_if_step.rb:19:in 'Service::Base::OnlyIfStep#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base.rb:260:in 'block in Service::Base#run!'
lib/service/base.rb:260:in 'Array#each'
lib/service/base.rb:260:in 'Service::Base#run!'
lib/service/base.rb:253:in 'Service::Base#run'
lib/service/base.rb:226:in 'Service::Base::ClassMethods#call'
lib/service/runner.rb:152:in 'Service::Runner#result'
lib/service/runner.rb:137:in 'Service::Runner#call'
lib/service/runner.rb:132:in 'Service::Runner.call'
lib/service/base.rb:227:in 'Service::Base::ClassMethods#call'
app/controllers/nested_topics_controller.rb:146:in 'NestedTopicsController#list_roots_response'
app/controllers/nested_topics_controller.rb:23:in 'NestedTopicsController#show'
app/controllers/application_controller.rb:452:in 'block in ApplicationController#with_resolved_locale'
app/controllers/application_controller.rb:452:in 'ApplicationController#with_resolved_locale'
app/controllers/application_controller.rb:1101:in 'ApplicationController#ensure_d...
plugins/discourse-post-voting/extensions/topic_view_extension.rb:88:in 'PostVoting::TopicViewExtension#next_page'
plugins/discourse-ai/lib/embeddings/entry_point.rb:41:in 'block (2 levels) in TopicViewSerializer#inject_into'
(eval at active_model_serializers-0.8.4/lib/active_model/serializer.rb:467):89:in 'TopicViewSerializer#_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in 'ActiveModel::Serializer#attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in 'ActiveModel::Serializer#_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in 'ActiveModel::Serializer#serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in 'ActiveModel::Serializer#as_json'
lib/nested_replies/post_tree_serializer.rb:88:in 'NestedReplies::PostTreeSerializer#topic_view_json'
lib/nested_replies/post_tree_serializer.rb:20:in 'NestedReplies::PostTreeSerializer#serialize_topic'
app/services/nested_topic/list_roots.rb:124:in 'NestedTopic::ListRoots#enrich_with_topic_metadata'
lib/service/base/step.rb:43:in 'BasicObject#instance_exec'
lib/service/base/step.rb:43:in 'Service::Base::Step#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base/only_if_step.rb:19:in 'block in Service::Base::OnlyIfStep#run_step'
lib/service/base/only_if_step.rb:19:in 'Array#each'
lib/service/base/only_if_step.rb:19:in 'Service::Base::OnlyIfStep#run_step'
lib/service/base/step.rb:21:in 'block in Service::Base::Step#call'
lib/service/base/step.rb:52:in 'Service::Base::Step#with_runtime'
lib/service/base/step.rb:21:in 'Service::Base::Step#call'
lib/service/base.rb:260:in 'block in Service::Base#run!'
lib/service/base.rb:260:in 'Array#each'
lib/service/base.rb:260:in 'Service::Base#run!'
lib/service/base.rb:253:in 'Service::Base#run'
<internal:kernel>:91:in 'Kernel#tap'
lib/service/base.rb:226:in 'Service::Base::ClassMethods#call'
lib/service/runner.rb:152:in 'Service::Runner#result'
lib/service/runner.rb:137:in 'Service::Runner#call'
lib/service/runner.rb:132:in 'Service::Runner.call'
lib/service/base.rb:227:in 'Service::Base::ClassMethods#call'
app/controllers/nested_topics_controller.rb:146:in 'NestedTopicsController#list_roots_response'
app/controllers/nested_topics_controller.rb:23:in 'NestedTopicsController#show'
actionpack (8.0.5) lib/action_controller/metal/basic_implicit_render.rb:8:in 'ActionController::BasicImplicitRender#send_action'
actionpack (8.0.5) lib/abstract_controller/base.rb:215:in 'AbstractController::Base#process_action'
actionpack (8.0.5) lib/action_controller/metal/rendering.rb:193:in 'ActionController::Rendering#process_action'
actionpack (8.0.5) lib/abstract_controller/callbacks.rb:261:in 'block in AbstractController::Callbacks#process_action'
activesupport (8.0.5) lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'
app/controllers/application_controller.rb:452:in 'block in ApplicationController#with_resolved_locale'
i18n (1.14.8) lib/i18n.rb:354:in 'I18n::Base#with_locale'
app/controllers/application_controller.rb:452:in 'ApplicationController#with_resolved_locale'
activesupport (8.0.5) lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
app/controllers/application_controller.rb:1101:in 'ApplicationController#ensure_dont_cache_page'
activesupport (8.0.5) lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
activesupport (8.0.5) lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks'
actionpack (8.0.5) lib/abstract_controller/callbacks.rb:260:in 'AbstractController::Callbacks#process_action'
actionpack (8.0.5) lib/action_controller/metal/rescue.rb:27:in 'ActionController::Rescue#process_action'
actionpack (8.0.5) lib/action_controller/metal/instrumentation.rb:76:in 'block in ActionController::Instrumentation#process_action'
activesupport (8.0.5) lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument'
activesupport (8.0.5) lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
activesupport (8.0.5) lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'
actionpack (8.0.5) lib/action_controller/metal/instrumentation.rb:75:in 'ActionController::Instrumentation#process_action'
actionpack (8.0.5) lib/action_controller/metal/params_wrapper.rb:259:in 'ActionController::ParamsWrapper#process_action'
activerecord (8.0.5) lib/active_record/railties/controller_runtime.rb:39:in 'ActiveRecord::Railties::ControllerRuntime#process_action'
actionpack (8.0.5) lib/abstract_controller/base.rb:152:in 'AbstractController::Base#process'
actionview (8.0.5) lib/action_view/rendering.rb:40:in 'ActionView::Rendering#process'
rack-mini-profiler (4.0.1) lib/mini_profiler/profiling_methods.rb:90:in 'block in ActionController::Base#profile_method' 
actionpack (8.0.5) lib/action_controller/metal.rb:252:in 'ActionController::Metal#dispatch'
actionpack (8.0.5) lib/action_controller/metal.rb:335:in 'ActionController::Metal.dispatch'
actionpack (8.0.5) lib/action_dispatch/routing/route_set.rb:67:in 'ActionDispatch::Routing::RouteSet::Dispatcher#dispatch'
actionpack (8.0.5) lib/action_dispatch/routing/route_set.rb:50:in 'ActionDispatch::Routing::RouteSet::Dispatcher#serve'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:53:in 'block in ActionDispatch::Journey::Router#serve'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:133:in 'block in ActionDispatch::Journey::Router#find_routes'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:126:in 'Array#each'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:126:in 'ActionDispatch::Journey::Router#find_routes'
actionpack (8.0.5) lib/action_dispatch/journey/router.rb:34:in 'ActionDispatch::Journey::Router#serve'
actionpack (8.0.5) lib/action_dispatch/routing/route_set.rb:908:in 'ActionDispatch::Routing::RouteSet#call'
lib/middleware/omniauth_bypass_middleware.rb:35:in 'Middleware::OmniauthBypassMiddleware#call'
lib/middleware/crawler_hooks.rb:13:in 'Middleware::CrawlerHooks#call'
rack (2.2.23) lib/rack/tempfile_reaper.rb:15:in 'Rack::TempfileReaper#call'
rack (2.2.23) lib/rack/conditional_get.rb:27:in 'Rack::ConditionalGet#call'
rack (2.2.23) lib/rack/head.rb:12:in 'Rack::Head#call'
actionpack (8.0.5) lib/action_dispatch/http/permissions_policy.rb:38:in 'ActionDispatch::PermissionsPolicy::Middleware#call'
lib/content_security_policy/middleware.rb:12:in 'ContentSecurityPolicy::Middleware#call'
lib/middleware/anonymous_cache.rb:417:in 'Middleware::AnonymousCache#call'
lib/middleware/csp_script_nonce_injector.rb:12:in 'Middleware::CspScriptNonceInjector#call'
lib/middleware/track_view_session_id_injector.rb:12:in 'Middleware::TrackViewSessionIdInjector#call'
config/initializers/008-rack-cors.rb:26:in 'Discourse::Cors#call'
rack (2.2.23) lib/rack/session/abstract/id.rb:266:in 'Rack::Session::Abstract::Persisted#context'
rack (2.2.23) lib/rack/session/abstract/id.rb:260:in 'Rack::Session::Abstract::Persisted#call'
actionpack (8.0.5) lib/action_dispatch/middleware/cookies.rb:706:in 'ActionDispatch::Cookies#call'
actionpack (8.0.5) lib/action_dispatch/middleware/callbacks.rb:31:in 'block in ActionDispatch::Callbacks#call'
activesupport (8.0.5) lib/active_support/callbacks.rb:100:in 'ActiveSupport::Callbacks#run_callbacks'
actionpack (8.0.5) lib/action_dispatch/middleware/callbacks.rb:30:in 'ActionDi
1개의 좋아요

중첩(nesting)과 게시물 투표는 아직 호환되지 않을 가능성이 높습니다

5개의 좋아요

네 – 현재로서는 토픽에 중첩이 활성화된 경우 로직을 건너뛰도록 게시글 투표 플러그인에 몇 가지 확인 사항을 추가하는 것이 가장 좋은 해결책이라고 생각합니다. 기본적으로 플러그인을 중첩 답변과 호환되지 않도록 명시적으로 만드는 것입니다.

게시글 투표에 “중첩 답변으로 전환” 모드가 있으면 좋겠습니다. 게시글 투표 사용자의 일부는 단순히 중첩 답변으로 전환하고 싶어 할 것이라고 추측합니다.

1개의 좋아요

@Falco 중첩된 토픽의 투표 기능을 비활성화합니다 DEV: Disable post voting plugin on nested replies topics - Pull Request #40305 - discourse/discourse - GitHub

2개의 좋아요

이거 보셨나요?

1개의 좋아요

아니요, 아직 그렇지 않아요! 중첩된 답글에 대한 게시글 투표 기능을 비활성화하는 아이디어가 훨씬 더 유사하기 때문에, 그리고 호환성 문제를 추가로 방지할 수 있으므로 여전히 그 쪽을 선호합니다 :thinking:

2개의 좋아요

비슷한 기능이 있는 것 같은데…

하지만 게시글 투표(post-voting)는 게시글에 동의하거나 반대하는 기능을 합니다. 기본적으로 중첩 보기(nested view)를 사용하는 사용자들이 게시글 투표 주제를 열었다가, 플랫 보기(flat view)의 다른 사용자는 투표할 수 있는 반면 자신은 투표할 수 없다는 사실을 알게 되면 당혹스러울 수 있습니다.

아마도 지원을 추가하는 것이 더 나은 아이디어일까요? 이 부분은 확신이 서지 않습니다.

2개의 좋아요

일단 중첩된 답변에 대해서는 이 기능을 비활성화할 예정입니다. 향후에는 중첩된 답변에 직접 업보트/다운보트 기능을 내장하여, 게시물 투표보다 더 나은 직접적인 대체 수단이 될 수 있도록 고려해 볼 수 있습니다.

1개의 좋아요

이것이 더 나은 방법입니다. 중첩된 답변에 투표 기능을 추가하면 상위 순서가 더 의미 있어집니다.

1개의 좋아요

네, 사실 중첩된 답글이든 아니든, vote 기능이 있어야 합니다. 현재 post vote와 nest view에 대해 몇 가지 변경을 가했습니다.


1개의 좋아요