Na página de reação/reação recebida em atividade/notificação, existe um bug.
Quando o usuário tenta rolar para baixo e carregar a próxima página, os mesmos itens são adicionados à lista, causando duplicação.
O problema decorre de um desalinhamento entre o frontend e o backend. O id definido no frontend é post_id, enquanto o backend exige reaction_id.
Um PR (Pull Request) rascunho está aqui, por favor, revise-o quando for conveniente.
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" />
2 curtidas
nat
(Natalie T)
Dezembro 4, 2025, 8:46am
2
Obrigado pelo rascunho do PR, parece que a paginação para reações está imprecisa agora e parece se repetir.
Não tenho certeza se a correção correta é definir o post_id. Parece que a paginação usa before_reaction_user_id (veja aqui ). Potencialmente, até mesmo remover a linha 27 (o PR) ajudaria, já que provavelmente está definida na reação achatada (reaction) acima.
Obrigado pela sua resposta.
Vou inspecionar amanhã e ver se algo resolve isso.
1 curtida
nat
(Natalie T)
Dezembro 4, 2025, 9:07am
4
Legal, obrigado!
Para ser claro, acho que o before_reaction_user_id deveria ser o ID de discourse_reactions_reaction_users - acho que esse nome de variável é um pouco confuso. Sinta-se à vontade para esclarecer qualquer coisa aqui ou no chat.