In reaction/reaction-received page on activity/notification, there exists a bug.
When user trying to scroll down and load the next page, there will be the same items added to the list, causing duplication.
The issue stems from a misalignment between the frontend and the backend. The id defined in the frontend is post_id while the backend requires reaction_id.
A draft PR is here, please review it when convenient.
main ← small-lovely-cat:fix-discourse-reactions
opened 07:29AM - 04 Dec 25 UTC
The issue was caused by a mismatch in frontend/backend behavior.
The backend … query requires `discourse_reactions_reaction_users.id < before_reaction_id`, but the `before_reaction_id` frontend gives is actually the last `post_id` rather than `id`(reaction_id), this caused a misalignment and thus prevent the `/activity/reactions` and `/notifications/reactions-received` from loading the next page.
This commit fixs the misalignment in the frontend by changing the wrong cast `id: reaction.post.id` to `post_id: reaction.post.id`, and thus the `id` in the response is kept.
Before fix:
<img width="926" height="259" alt="image" src="https://github.com/user-attachments/assets/69487f35-e05e-4922-b19e-e91375815332" />
Then the next request(`before_reaction_user_id` = 10939178 = `post_id` from last request)
<img width="1145" height="258" alt="image" src="https://github.com/user-attachments/assets/a0c699af-e7ff-416c-b09b-dca201ebe32c" />
---
After fix:
<img width="1284" height="265" alt="image" src="https://github.com/user-attachments/assets/c9025b4f-caa5-42c5-8522-5296d03adb63" />
<img width="1277" height="264" alt="image" src="https://github.com/user-attachments/assets/3c1230dc-9deb-44f3-a63b-bdc8cb75db0e" />
3 likes