Add idempotent v2 vote endpoint - #66
Merged
Merged
Conversation
DavidMoritz
force-pushed
the
codex/expo-v2-votes
branch
from
August 17, 2026 13:57
f12bdac to
99d59d8
Compare
DavidMoritz
approved these changes
Aug 17, 2026
DavidMoritz
left a comment
Owner
There was a problem hiding this comment.
Excellent endpoint design, Emmanuel! The idempotency pattern here is rock-solid — the double-check on duplicate key insert for race conditions, hash_equals() for timing-safe comparison, and the clean typed error envelope are all exactly right. The 9 test cases cover the important edge cases thoroughly, and every query is properly parameterized.
The way you've structured the validation to collect all field errors before responding is a really nice touch for client ergonomics. This is production-quality API work. Thank you so much for this — your dedication to getting the details right is what makes this project better! 🎯
DavidMoritz
marked this pull request as ready for review
August 17, 2026 13:57
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.
Summary
Verification
This intentionally returns typed blockers for name, secure-code, and grouping ballots; collecting those fields remains Phase 2.
Stack created with GitHub Stacks CLI.