All posts containing watched words are automatically hidden — score_to_hide_post is 0.0

AI-generated summary

User copymonopoly reported a critical issue where posts containing watched words were being automatically hidden immediately upon flagging, despite no recent configuration changes. Investigation revealed the site’s score_to_hide_post value was set to 0.0, whereas a normal instance typically shows a value around 8.3. This setting determines the threshold of flags required to hide a post; a value of 0.0 means even a single flag from a new user triggers an automatic hide copymonopoly.

User jahan_gagan suggested adjusting the Hide Post Sensitivity site setting to Medium or High to restore the threshold. However, copymonopoly found that changing this setting had no effect; the score_to_hide_post remained 0.0 regardless of the selection, with only the Disabled option working. This led to a discussion on potential system misconfigurations, such as corrupt values in the PluginStore or issues with reviewable_default_visibility jahan_gagan. Despite rebuilding the site and verifying default settings, the issue persisted copymonopoly.

Upon analyzing the Discourse source code, copymonopoly determined that score_to_hide_post is calculated using sensitivity values and priority scores. The formula should never result in 0 under normal circumstances. The user concluded that a value of 0.0 is mathematically impossible in standard operation, indicating a definitive bug or a corrupted internal state where the high priority score is unexpectedly 0.

I’ve run into a serious issue with my Discourse forum.

Recently I found that all posts containing watched words that trigger a flag are automatically hidden.
These posts must be manually unhidden by an admin to become visible again.

After some investigation, I noticed that my site’s score_to_hide_post value is currently 0.0.
On another Discourse instance I run, this value is around 8.3, which seems normal.

Because of this 0.0 value, any flag — even a single one from a watched word — immediately hides the post.

I haven’t made any setting changes recently. Why would score_to_hide_post become 0.0?

How can I restore it to a normal threshold (like 8.3) so that posts aren’t hidden right away?

I found that since score_to_hide_post is 0.0, even a single flag from a new user will immediately hide the post, which makes the situation quite serious. What should I do?

You can fix this by adjusting the Hide Post Sensitivity site setting. Set it to a suitable level such as Medium or High — this will automatically update the internal score_to_hide_post value back to a healthy threshold.

Just note that the lower the sensitivity, the less flag score is required to hide a post — which is why posts were getting hidden immediately.

Reference for how this maps internally:

Thanks for the suggestion! I tried adjusting the Hide Post Sensitivity site setting in the admin panel, which has four options: Disabled, Low, Medium, and High.
However, I found that only Disabled works. No matter whether I choose Low, Medium, or High, the score_to_hide_post value remains 0.
Do you know why this happens?

I have a question regarding score_to_hide_post.

I understand that score_to_hide_post is dynamically calculated based on reviewables, but is it possible for it to ever be calculated as 0 under normal circumstances?

If it is showing 0, does that indicate a system problem?

AFIK, in standard operation with Hide Post Sensitivity set to “Low, Medium, or High”, the threshold should be a positive number. If you see score_to_hide_post = 0 when the sensitivity is NOT “Disabled”, this indicates a system misconfiguration. Possible causes include:

  • Corrupt or missing values in the PluginStore
  • Issues with your SiteSettings (e.g., reviewable_default_visibility misconfigured)

The reviewable_default_visibility setting is still at its default value, low. After the issue occurred, I even tried rebuilding the site, but it did not resolve the problem. I would like to understand how this issue appeared in the first place and whether it can be fixed.

I’ve studied the code carefully and found that score_to_hide_post is determined by the following three methods:

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

So, in other words,
score_to_hide_post = ((high.to_f * ratio) * scale).truncate(2)

where

  • high.to_f may unexpectedly be 0 (it should normally be a positive value),
  • ratio = sensitivity / sensitivities[:low].to_f,
  • sensitivity comes from the setting (for example 3, 6, or 9),
  • sensitivities[:low] = 9,
  • scale = 1.0.

That means score_to_hide_post should never be 0, so if it becomes 0, this clearly indicates a bug.