What both posts have in common is that there are reactions, but the number of likes does not appear to be available as the count in the actions_summary.
Depending on if you reacted on the post yourself or not, id: 2 is either missing in the actions_summary, or if you haven’t reacted you can see that the count is missing. If I understand correctly, id: 2 is included if either you could react (can_act) or count>0.
In this case, the count: 2 is missing for both users. For the user who has already reacted this results in id: 2 missing completely. This seems to explain why reactions are not shown for the user who reacted, even though reactions exist.
On this post the count is available and the reactions appear as expected.
I have no idea how many posts here on Meta are affected by this or whether other forums are also affected. And I can’t provide any steps on why the data is missing. I can only report that for some posts, the reactions are not displayed on mobile phones and are only partially displayed on laptops, and the cause for this seems to be related to the missing data.
Were you able to find out how this happened? I only found examples from 2023 and the beginning of 2024. So I wondered if something with the data before all reactions were counted as likes is different than after that change.
So I tried what happens if I use a reaction that is excluded from counting as a like, but then “can_act” is still true even if “can_undo” for current_user_reaction is false.
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:
Reactions exist in discourse_reactions_reaction_users
But there are no corresponding PostAction records
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.