-
Notifications
You must be signed in to change notification settings - Fork 4
Feat/evoting reveal vote data #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Caution Review failedThe pull request is closed. WalkthroughIntroduces a blind-vote reveal flow across wallet and eVoting, adds SSE-based vote-status monitoring via a new API endpoint and client subscription, updates vote/result rendering by mode and visibility, removes click-outside behavior from a drawer, and bumps package/version labels. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Scanner as QR Scanner
participant ScanPage as Wallet Scan QR Page
participant Storage as localStorage
participant Drawer as Reveal Vote Drawer
User->>Scanner: Scan QR
Scanner-->>ScanPage: Content (e.g., w3ds://reveal?pollId=...)
ScanPage->>ScanPage: Parse reveal URI, extract pollId
ScanPage->>Storage: Read blindVote_<pollId>
alt Vote data found and owner matches
ScanPage->>ScanPage: Resolve chosen option
ScanPage->>Drawer: Open with revealedVoteData
Drawer-->>User: Show revealed option and pollId
else Error/ownership mismatch
ScanPage-->>User: Display revealError
end
sequenceDiagram
autonumber
participant Client as BlindVotingInterface (web)
participant API as /api/votes/:pollId/status/:userId
participant Service as VoteService
Client->>API: Establish SSE connection
API-->>Client: event: connected
API->>Service: getUserVote(pollId, userId)
Service-->>API: { hasVoted, vote|null }
API-->>Client: event: vote_status { hasVoted, vote, ts }
loop every 2s
API->>Service: getUserVote(pollId, userId)
Service-->>API: { hasVoted, vote|null }
API-->>Client: event: vote_status { ... }
alt Transition to hasVoted=true
Client->>Client: onVoteSubmitted()
end
end
Client-->>API: close/disconnect
API->>API: clearInterval, end response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (9)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Description of change
Issue Number
Type of change
How the change has been tested
Change checklist
Summary by CodeRabbit
New Features
Improvements
Chores