discourse/plugins/poll
Charles Lechasseur 14ee6bd67d
FIX: Avoid returning duplicate voters from /polls/voters.json endpoint (#34433)
When fetching voters from the `/polls/voters.json` API endpoint, each
page after the first has an extra voter (the last one from the previous
page). This causes duplicate voters to be returned if loading multiple
pages. This PR fixes the off-by-one error that causes this. (This fix
has initially been proposed by Rob Mackenzie.)

The PR also fixes an issue that could cause non-deterministic ordering
of results from that API; however, I have not been able to craft a test
to reproduce the issue, so the fix is theoretical.

Reported here:
https://meta.discourse.org/t/polls-voters-json-returning-duplicate-users-across-paged-requests/376636
2025-09-30 15:06:01 +08:00
..
app DEV: Normalize route and namespace setup in plugins (#34962) 2025-09-25 12:35:29 +02:00
assets DEV: Replace Ember's deprecated mapBy with standard .map (#34963) 2025-09-26 12:59:35 -03:00
config Update translations (#35031) 2025-09-29 10:26:53 +02:00
db/migrate FEATURE: dynamic poll support (#34368) 2025-08-19 16:43:36 +10:00
jobs/regular DEV: Apply syntax_tree formatting to plugins/* 2023-01-07 11:11:37 +00:00
lib FIX: Avoid returning duplicate voters from /polls/voters.json endpoint (#34433) 2025-09-30 15:06:01 +08:00
spec FIX: Avoid returning duplicate voters from /polls/voters.json endpoint (#34433) 2025-09-30 15:06:01 +08:00
test/javascripts FEATURE: dynamic poll support (#34368) 2025-08-19 16:43:36 +10:00
plugin.rb DEV: Normalize route and namespace setup in plugins (#34962) 2025-09-25 12:35:29 +02:00