Skip to content

Deduplicate Registered Voters View#122

Merged
atomauro merged 4 commits intomainfrom
fix/deduplicate-registered-voters
Feb 18, 2026
Merged

Deduplicate Registered Voters View#122
atomauro merged 4 commits intomainfrom
fix/deduplicate-registered-voters

Conversation

@atomauro
Copy link
Copy Markdown
Contributor

@atomauro atomauro commented Feb 11, 2026

Summary

The "Hasn't voted" list contained duplicate entries for certain users (e.g., betaalpha.near). This was traced back to the registered_voters view returning multiple rows for a single user due to multiple deploy_lockup events not being filtered correctly.

Changes

  • Modified registered_voters.sql to use ROW_NUMBER() OVER (PARTITION BY registered_voter_id ...) logic.
  • This ensures we strictly select only the first valid registration event per user, eliminating duplicates at the source without the performance cost of a global DISTINCT.

@atomauro atomauro changed the title Deduplicate registered voters using ROW_NUMBER Deduplicate registered voters Feb 11, 2026
@atomauro atomauro changed the title Deduplicate registered voters Deduplicate Registered Voters View Feb 11, 2026
@atomauro atomauro self-assigned this Feb 11, 2026
@atomauro atomauro requested a review from jcarnide February 11, 2026 17:32
@atomauro atomauro merged commit b518a0c into main Feb 18, 2026
3 checks passed
@atomauro atomauro deleted the fix/deduplicate-registered-voters branch February 18, 2026 17:12
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.

2 participants