제안해 주셔서 감사합니다! 관리 패널에서 Hide Post Sensitivity 사이트 설정을 조정해 보았는데, 이 설정에는 Disabled, Low, Medium, High 네 가지 옵션이 있습니다.
그러나 Disabled만 제대로 동작했습니다. Low, Medium, High 중 어떤 옵션을 선택하든 score_to_hide_post 값은 0으로 유지됩니다.
이러한 현상이 발생하는 이유를 아시나요?
제 생각에는, “게시물 민감도 숨김” 설정이 "낮음, 중간, 또는 높음"으로 되어 있는 표준 운영 환경에서 임계값은 양의 숫자여야 합니다. 민감도가 "비활성"이 아닌 상태에서 score_to_hide_post = 0을 확인하게 된다면, 이는 시스템 구성 오류를 나타냅니다. 가능한 원인은 다음과 같습니다:
PluginStore의 손상되거나 누락된 값
SiteSettings 관련 문제(예: reviewable_default_visibility 구성 오류)
코드를 주의 깊게 검토한 결과, score_to_hide_post는 다음 세 가지 메서드에 의해 결정되는 것을 확인했습니다:
def self.sensitivity_score_value(sensitivity, scale)
return Float::MAX if sensitivity == 0
ratio = sensitivity / sensitivities[:low].to_f
high =
(PluginStore.get("reviewables", "priority_#{priorities[:high]}") || typical_sensitivity).to_f
# We want this to be hard to reach
((high.to_f * ratio) * scale).truncate(2)
end
def self.sensitivity_score(sensitivity, scale: 1.0)
# If the score is less than the default visibility, bring it up to that level.
# Otherwise we have the confusing situation where a post might be hidden and
# moderators would never see it!
[sensitivity_score_value(sensitivity, scale), min_score_for_priority].max
end
def self.score_required_to_hide_post
sensitivity_score(SiteSetting.hide_post_sensitivity)
end
즉, 다시 말해, score_to_hide_post = ((high.to_f * ratio) * scale).truncate(2)
여기서
high.to_f는 의도치 않게 0일 수 있습니다(보통은 양의 값이어야 합니다),
ratio = sensitivity / sensitivities[:low].to_f,
sensitivity는 설정에서 가져온 값입니다(예: 3, 6, 또는 9),
sensitivities[:low] = 9,
scale = 1.0.
따라서 score_to_hide_post는 절대 0이 될 수 없으므로, 0이 된다면 이는 분명히 버그임을 의미합니다.