mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 05:21:05 +08:00
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 |
||
|---|---|---|
| .. | ||
| app | ||
| assets | ||
| config | ||
| db/migrate | ||
| jobs/regular | ||
| lib | ||
| spec | ||
| test/javascripts | ||
| plugin.rb | ||