Proposal fixes - #3194
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughComponent post-vote UI state and query/mutation hooks are refactored to improve proposal voting. The component now keeps the post-vote banner mounted on successful vote, query hooks refactor vote metadata caching with username scoping, and mutation execution shifts to SDK operation builders with explicit cache invalidation. ChangesProposal Voting Flow Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR fixes several bugs in the proposal-vote feature: widening the status filter to surface upcoming (not-yet-started) proposals, removing a cache-corrupting
Confidence Score: 5/5Safe to merge — all changes are targeted bug fixes with no regressions on the hot path. The changes are well-scoped defensive improvements: null-safety guards, a narrowed cache write (removing the boolean initialData), an SDK helper adoption, and a small UX fix for the post-vote banner. The logic around skipRender is carefully ordered so !isLoggedIn still gates everything. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as ProposalVoteRequest
participant VQ as useProposalVotedQuery
participant VM as useProposalVoteMutation
participant QC as QueryClient
participant Chain as Hive Chain
UI->>VQ: query(proposalId, username)
VQ-->>UI: "data=false (not voted)"
Note over UI: skipRender=false → banner shown
UI->>VM: "mutate({ proposalId })"
VM->>Chain: buildProposalVoteOp → broadcast
Chain-->>VM: success
VM->>QC: invalidateQueries(userVotesKey)
VM->>UI: "isSuccess=true"
Note over UI: skipRender=false (isSuccess guard)<br/>voteCasted=true → thank-you state
QC->>VQ: refetch
VQ-->>UI: "data=true (voted)"
Note over UI: On next session: data=true → skipRender=true
Reviews (2): Last reviewed commit: "fix op" | Re-trigger Greptile |
Summary by CodeRabbit
Bug Fixes
Improvements