A user changing their like to a reaction can lead to wrong numbers in notification menu

סיכום מבוסס בינה מלאכותית

A user reports a bug where changing a like to a reaction results in incorrect notification counts. Moin explains that a post with 4 reactions (2 :heart: and 2 :clap:) shows 2 reactions and 3 likes in notifications, totaling 5, which is inaccurate. The issue occurs when a user who initially liked a post changes their interaction to a reaction, leading to separate notifications instead of a single grouped one. The expected behavior is a unified notification for all reactions and likes, or at least accurate counts. The bug appears to stem from the reaction plugin and notification logic, particularly when ‘notify when liked’ is set to ‘always’.

As you can see in the screenshot below, there are a total of 4 reactions on my post (2 :heart: and 2 :clap:). But my notifications say there are 2 reactions and 3 likes on the post.

Prerequisites:

  • I am not sure if this is needed, but my “notify when liked” preference is configured to “always”.
  • The reaction plugin is enabled, and at least a second reaction is configured for discourse reactions enabled reactions. All the other reaction settings are default.
  • You have your account and 4 test users

Steps to reproduce:

  1. Create a topic with your user
  2. Impersonate/log in as your first test user and select the reaction on the post (I used :clap:)
  3. Impersonate/log in as your second test user and like the post.
  4. Impersonate/log in as your third test user and like the post.
  5. Impersonate/log in as your fourth test user and like the post.
  6. (optional) Take a look at the author’s notifications - there is 1 notification about 4 reactions indicated by a heart icon.
  7. Impersonate/log in as your fourth test user again and change your like into a reaction.
  8. Check the notifications of the post author

Expected result: Likes and reactions are grouped as one notification saying 4 reactions either with a heart or a reactions icon.
Actual result: There are 2 notifications - one about the 2 reactions and one about 3 likes (1 and 2 other users), which is a total of 5.

I think it would be great if the notification remained a grouped notification, including both likes and reactions. If separating them is unavoidable, it would be nice if the number could at least be fixed.