fix(comments): show vote counts optimistically - #75
Conversation
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1ef8342. Configure here.

Summary
useComment,useComments, anduseRepliesVerification
yarn buildyarn test(1,142 passed, 6 skipped)yarn test:coverage:hooks-storescompleted its test run, but the repository-wide 100% verifier reports pre-existing coverage gaps in unrelated hooks and stores.Closes #74
Note
Medium Risk
Vote count logic spans multiple stores and rapid vote transitions; incorrect reconciliation could show wrong scores until the next update, but behavior is heavily tested and scoped to display-layer adjustments.
Overview
useComment,useComments, anduseRepliesnow bumpupvoteCount/downvoteCountas soon as the active account’s pending vote is stored, instead of waiting for the network comment to refresh.A new
optimistic-vote-countshelper records baseline and transition metadata onpublishVote, reconciles counts against stale copies of the same comment in different stores, and drops the adjustment once a canonical update already reflects the latest vote.getFreshestLoadedCommentpicks the newest loaded comment snapshot when recording that metadata.Docs note the behavior; hook, store, and utility tests cover rapid vote changes and reply/comment lists.
Reviewed by Cursor Bugbot for commit f79e9de. Bugbot is set up for automated code reviews on this repo. Configure here.