Skip to content

Fix unconfigured voting options being skipped at 3 votes - #72

Merged
IvoLeist merged 5 commits into
mainfrom
copilot/fix-matching-votes-skipping
Feb 23, 2026
Merged

Fix unconfigured voting options being skipped at 3 votes#72
IvoLeist merged 5 commits into
mainfrom
copilot/fix-matching-votes-skipping

Conversation

Copilot AI commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Voting options not present in voting_options_max_matching_votes were being skipped with a default limit of 3 votes. For example, none_of_above was skipped even though only yes, diff_var, and germline were configured with limits.

Changes

R/mod_voting.R

  • Changed NULL/NA max_votes handling from defaulting to 3 to skipping the limit check entirely via next
# Before: applied 3-vote limit to unconfigured options
if (is.null(max_votes) || is.na(max_votes)) {
  max_votes <- 3
}

# After: no limit for unconfigured options
if (is.null(max_votes) || is.na(max_votes)) {
  print(paste("Skipping limit check for option:", option_key))
  next
}

tests/testthat/test-voting-module.R

  • Added test verifying unconfigured options are never skipped regardless of vote count
  • Added test verifying configured options still skip correctly at their limit
  • Parameterized all SQL queries

Result

  • Options in voting_options_max_matching_votes: Limited as configured
  • Options not in voting_options_max_matching_votes: No limit applied
Original prompt

This section details on the original issue you should resolve

<issue_title>Matching votes skipping unexpectedly triggered for a category not present in config "voting_options_max_matching_votes"</issue_title>
<issue_description>Observed:
Skipping got triggered for the option none_of_above (see below)

coordinates REF ALT agreement observation comment shinyauthr_session_id time_till_vote_casted_in_seconds
chr11:110816223 AG A skipped - max matching votes (3) for option (none_of_above) reached NA NA X4INbEVKBRtJUtAmJ1ac9mJ3ygNZkTDyH9gfvC3pibxeqM2371wdtvroOfTYaucR NA

Even though it is not set inside the config

voting_options_max_matching_votes:
  'yes': 9
  diff_var : 9
  germline: 9

Expected:
The options which are not inside voting_options_max_matching_votes should not have any matching votes limit.
-> Should never be skipped</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 26, 2026 17:32
Changed logic to skip limit check entirely for options not in voting_options_max_matching_votes instead of defaulting to 3. Added tests to validate the fix.

Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix matching votes skipping for unset options Fix unconfigured voting options being skipped at 3 votes Jan 26, 2026
Copilot AI requested a review from IvoLeist January 26, 2026 17:38
@IvoLeist
IvoLeist marked this pull request as ready for review February 23, 2026 15:48
@IvoLeist
IvoLeist merged commit 0c5a560 into main Feb 23, 2026
1 check passed
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.

Matching votes skipping unexpectedly triggered for a category not present in config "voting_options_max_matching_votes"

2 participants