Skip to content

Refuse skipping a task that isn't the juror's own - #677

Open
lgelauff wants to merge 1 commit into
masterfrom
fix/skip-vote-raise-errors
Open

lgelauff wants to merge 1 commit into
masterfrom
fix/skip-vote-raise-errors

Conversation

@lgelauff

Copy link
Copy Markdown
Collaborator

Fixes #674.

JurorDAO.skip_voting() returned InvalidAction instead of raising it, so a skip of another juror's task, of a task that doesn't exist, or in a round the juror isn't in answered "success" and did nothing. Both errors are now raised, so the endpoint answers 400.

It also refuses a task from a different round than the one in the URL. Before, that answered 200 and stored a stray id in the other round's list of skipped tasks.

Tests

  • New test_skip_refuses_votes_of_other_users: skipping another juror's task, a task that doesn't exist, the juror's own task through another round's URL, and a task after the juror was removed from the round all give 400, and the juror's own first task is unchanged. It fails on master ('success' == 'failure'), and the wrong-round case fails if the new round check is taken out.
  • Full suite: 172 passed, 3 xfailed.

Written by Claude (Claude Code) on behalf of @lgelauff.

🤖 Generated with Claude Code

JurorDAO.skip_voting() returned InvalidAction instead of raising it, so
POST /juror/round/<id>/tasks/skip answered {"success": true} for a vote id
of another juror, a vote id that doesn't exist, or a round the juror is not
in, and did nothing. Raise both errors so the endpoint answers 400.

Also refuse a vote id that belongs to a different round than the one in
the URL; before, that answered 200 and stored a stray id in the other
round's skipped list.

Adds a regression test (fails before the fix with status 'success').

Fixes #674.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

Skipping a task that isn't the juror's own reports success and does nothing

1 participant