Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same winner(s) listed twice consecutively #27

Open
adheeshparelkar opened this issue Jan 21, 2025 · 2 comments
Open

Same winner(s) listed twice consecutively #27

adheeshparelkar opened this issue Jan 21, 2025 · 2 comments

Comments

@adheeshparelkar
Copy link
Collaborator

Since the last few raffles, raffle bot has been randomly posting the same name twice.

Example 1: https://talk.vanhack.ca/t/welcome-to-2025-raffle-2/16006/11

dbynoe has been listed twice as number 9 and 10 for 21x Koonie Air Duster.

Goatwind has been listed twice as number 8 and 9 for ~10x Onevan Chainsaws

Example 2: https://talk.vanhack.ca/t/welcome-to-2025-raffle/15977/6

Eviickaaaa has been listed twice for 23 and 24 for 1 x IPEVO V4K Ultra High Definition USB Camera

@TyIsI
Copy link
Member

TyIsI commented Jan 21, 2025

I'm guessing this might be todo with the paging update.

@lukecyca
Copy link
Collaborator

First I instrumented the get_all_voters and was able to reproduce the first example (dbynoe for Koonie Air Duster). I reverted to the old paging implementation, and surprisingly got the same result.

I then manually checked the API requests/responses to Discourse for and I find that he is in fact returned twice. So I would conclude that this is not an issue with the paging logic on our end, but rather it's something like a bug in discourse, misuse of the API, misunderstanding of how an individual can "vote" twice for a poll, etc.

Here's the repro:

curl --request GET \
  --url 'https://talk.vanhack.ca/polls/voters.json?post_id=87127&poll_name=poll&option_id=4792f70da4aedcf4df07034901f70e77&page=1' \
  --header 'Accept: application/json' \
  --header 'Api-Key: <redacted>' \
  --header 'Api-Username: rafflebot'
  
curl --request GET \
  --url 'https://talk.vanhack.ca/polls/voters.json?post_id=87127&poll_name=poll&option_id=4792f70da4aedcf4df07034901f70e77&page=2' \
  --header 'Accept: application/json' \
  --header 'Api-Key: <redacted>' \
  --header 'Api-Username: rafflebot'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants