Reactions sometimes not displayed when like count is missing

That’s because discourse_reactions_like_sync_enabled is set to false. This was done intentionally by the migration from May 2024 to avoid disrupting existing data.

When this setting is disabled, the ReactionLikeSynchronizer doesn’t run. This synchronizer is responsible for:

  • Creating PostAction (like) records for reactions
  • Updating posts.like_count to reflect reactions

Without the sync running:

  1. Reactions exist in discourse_reactions_reaction_users
  2. But there are no corresponding PostAction records
  3. And posts.like_count remains at 0

Your intuition about the timing is spot on - the posts from 2023/early 2024 had reactions added when this sync wasn’t active, so their like_count was never updated. The old serializer logic then omitted the like action entirely when both count = 0 AND can_act = false (undo window expired).

The fix doesn’t correct the underlying data discrepancy - it simply ensures the UI displays reactions correctly even when the PostAction/like_count data isn’t synced. On sites where discourse_reactions_like_sync_enabled = false, reactions existing independently from PostAction records is expected behavior.

1 Like