0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 02:51:10 +08:00
discourse/plugins/poll/lib
Régis Hanol c51a159afb
FIX: Display poll voters in the order they voted (#41972)
Previously, public poll voters were displayed alphabetically by username
while pagination selected them chronologically — a regression from the
ranked choice feature (bae492efee) — so each "show more" appended an
alphabetically-sorted chunk of 25 and the overall list read as random.

This change orders voters by the same `ROW_NUMBER()` over `created_at`
that already drives pagination, restoring the pre-2024 chronological
display and aligning display order with page selection. A `user_id`
tiebreaker makes the order deterministic when votes share a timestamp
(e.g. bulk imports), and the now unused `username` column is dropped
from the query. The specs previously sorted voters by id before
asserting — which is how the regression went unnoticed — and now assert
the actual order, with vote order deliberately different from id order
so any alphabetical or id-based ordering fails.
2026-07-24 15:35:15 +02:00
..
poll DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
poll.rb FIX: Display poll voters in the order they voted (#41972) 2026-07-24 15:35:15 +02:00
polls_updater.rb FEATURE: Record who closed a poll (#40989) 2026-06-29 12:22:43 +02:00
polls_validator.rb DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
post_extension.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
post_validator.rb
ranked_choice.rb
user_extension.rb