في صفحة التفاعل/التفاعل المستلم في النشاط/الإشعار، يوجد خطأ.
عندما يحاول المستخدم التمرير لأسفل وتحميل الصفحة التالية، ستتم إضافة نفس العناصر إلى القائمة، مما يسبب التكرار.
ينبع الخلل من عدم التوافق بين الواجهة الأمامية (frontend) والواجهة الخلفية (backend). المعرّف (id) المحدد في الواجهة الأمامية هو post_id بينما تتطلب الواجهة الخلفية reaction_id.
يوجد طلب سحب (PR) مسودة هنا، يرجى مراجعته عندما يكون ذلك مناسبًا.
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 إعجابات