Skip to content

fix(voting): Vote Later permanently hides images — replace skip watermark with ID list (#371 #372)#499

Open
ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
ayushshukla1807:fix-vote-later-371
Open

fix(voting): Vote Later permanently hides images — replace skip watermark with ID list (#371 #372)#499
ayushshukla1807 wants to merge 1 commit intohatnote:masterfrom
ayushshukla1807:fix-vote-later-371

Conversation

@ayushshukla1807
Copy link
Copy Markdown

@ayushshukla1807 ayushshukla1807 commented Apr 15, 2026

Fixes #371 and #372.

The "Vote Later" skip logic was dropping tasks completely because it relied on a single integer watermark (skip) in round_juror.flags. Once a task's ID became less than that skip threshold, the get_tasks_from_round query excluded it permanently.

I've refactored skip_voting to maintain a basic list of skipped_ids instead. Now, skipped tasks are excluded temporarily and reappear once the rest of the queue is finished.

Added testing for this in test_web_basic.py.

…rmark with ID list (hatnote#371 hatnote#372)

Root cause:
  skip in round_juror.flags was a single integer watermark.
  get_tasks_from_round filtered Vote.id > skip, permanently hiding
  all tasks with lower IDs — including the skipped one — even after
  the juror finished all other images. 'Vote Later' became 'Vote Never'.

Fix:
  Replace the integer watermark with skipped_ids (list of vote IDs):
  - Non-skipped tasks are always served first.
  - Only when no non-skipped tasks remain are the skipped ones returned.
  - Legacy skip integer is migrated to list format on first access,
    so existing sessions with the old format are unaffected.

  Affected functions in rdb.py:
    - JurorDAO.get_tasks_from_round(): reads skipped_ids list,
      serves non-skipped first, then skipped as fallback.
    - JurorDAO.skip_voting(): appends to skipped_ids list,
      migrates legacy 'skip' key, removes old key after migration.

Tests:
  Added test_vote_later_reappears() to test_web_basic.py.
  Test was authored by @lgelauff and shared on PR hatnote#378.
  Verifies:
    1. Skipped task does not appear immediately after skipping.
    2. Skipped task reappears after all non-skipped tasks are voted.
  Result: 1 passed.

Fixes hatnote#371
Fixes hatnote#372
@ayushshukla1807
Copy link
Copy Markdown
Author

ayushshukla1807 commented Apr 15, 2026

Ran the full test suite locally on the fix-vote-later-371 branch. All 3 tests passed without issue, including the new regression test test_vote_later_reappears based on the reproduction snippet.

montage/tests/test_web_basic.py::test_home_client            PASSED  [ 33%]
montage/tests/test_web_basic.py::test_multiple_jurors        PASSED  [ 66%]
montage/tests/test_web_basic.py::test_vote_later_reappears   PASSED  [100%]

Also hit GET /v1/series directly from my local backend to make sure everything was wiring up properly. You can view the output here:
View local dev screenshots

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.

"Vote Later" doesn't let you vote later

1 participant