-
Notifications
You must be signed in to change notification settings - Fork 4
Chore/evoting fixes #336
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
Chore/evoting fixes #336
Conversation
Caution Review failedThe pull request is closed. WalkthroughUpdates span UI text in eID Wallet, frontend eVoting pages adding turnout display and end-of-vote refetch, PollResults type extensions, API bootstrap to start cron jobs, cron cadence change, deadline notification refactor, VoteService turnout and IRV ranking logic, and removal of debug logs in web3 subscribers. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant API as evoting-api
participant DB as Database
participant Cron as CronManagerService
participant DCS as DeadlineCheckService
participant Group as Group/Message System
rect rgba(220,235,255,0.5)
note over API: Startup
API->>DB: AppDataSource.initialize()
DB-->>API: ready
API->>Cron: startAllJobs()
Cron-->>API: "Cron jobs started successfully"
end
rect rgba(235,250,220,0.5)
note over Cron,DCS: Every 5 minutes
Cron->>DCS: checkExpiredPolls()
DCS->>DB: Query expired polls (deadline < now, not sent)
alt Any expired
loop For each expired poll
DCS->>Group: Send simple deadline message (title, voteId, link)
Group-->>DCS: ack
DCS->>DB: Mark deadlineMessageSent = true
end
else None
DCS-->>Cron: No expired polls
end
end
sequenceDiagram
autonumber
participant FE as eVoting Frontend
participant API as evoting-api VoteService
participant DB as Database
participant Group as Group Service
rect rgba(245,235,255,0.5)
note over FE: Poll page lifecycle
FE->>API: GET /polls/:id/results
API->>DB: Fetch poll, votes, groupId
opt rank mode
API->>API: tallyIRV(votes, options)
end
opt groupId present
API->>Group: getGroupMemberCount(groupId)
Group-->>API: totalEligibleVoters
API->>API: Compute turnout = totalVotes / eligible
end
API-->>FE: { results, totalVotes, totalEligibleVoters?, turnout? }
FE->>FE: Render results + turnout card
end
rect rgba(235,250,220,0.5)
note over FE: After "Voting has ended"
FE->>API: Re-fetch results
API-->>FE: Updated results
FE->>FE: Update UI
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (10)
✨ 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
Style