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
Open
Conversation
…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
Author
|
Ran the full test suite locally on the Also hit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #371 and #372.
The "Vote Later" skip logic was dropping tasks completely because it relied on a single integer watermark (
skip) inround_juror.flags. Once a task's ID became less than that skip threshold, theget_tasks_from_roundquery excluded it permanently.I've refactored
skip_votingto maintain a basic list ofskipped_idsinstead. 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.