Skip to content

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

Merged
lgelauff merged 1 commit into
hatnote:masterfrom
ayushshukla1807:fix-vote-later-371
Jun 18, 2026
Merged

fix(voting): Vote Later permanently hides images — replace skip watermark with ID list (#371 #372)#499
lgelauff merged 1 commit into
hatnote:masterfrom
ayushshukla1807:fix-vote-later-371

Conversation

@ayushshukla1807

@ayushshukla1807 ayushshukla1807 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

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.

@ayushshukla1807

ayushshukla1807 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

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

…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
@lgelauff
lgelauff force-pushed the fix-vote-later-371 branch from 926ac8a to 8d728a6 Compare June 18, 2026 08:42
@lgelauff

Copy link
Copy Markdown
Collaborator

Your second screenshot is very confusing. That doesnt look like a reproduction or a fix?

@lgelauff

Copy link
Copy Markdown
Collaborator

Was able to reproduce the original bug and that it is resolved on montage-beta.

The below screenshots are after following the exact same vote sequence before and after the fix.

Screenshot 2026-06-18 at 11 39 50 AM Screenshot 2026-06-18 at 11 40 20 AM

@mahmoud mahmoud left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lgelauff
lgelauff merged commit f61833e into hatnote:master Jun 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants