Skip to content

fix(subgraph): total-leaderboard-jurors-count #2048

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

Merged
merged 2 commits into from
Jul 21, 2025

Conversation

tractorss
Copy link
Contributor

@tractorss tractorss commented Jul 20, 2025

PR-Codex overview

This PR updates the version of the @kleros/kleros-v2-subgraph package and modifies the logic in the KlerosCore.ts file to include a call to juror.save() when a vote's choice is null.

Detailed summary

  • Updated version from 0.17.0 to 0.17.1 in subgraph/package.json.
  • Modified logic in subgraph/core/src/KlerosCore.ts:
    • Added juror.save(); before the continue; statement when vote.choice is null.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Bug Fixes
    • Improved vote handling to ensure juror updates are always saved, even when a vote has no choice.
  • Chores
    • Updated package version to 0.17.1.

@tractorss tractorss requested a review from a team as a code owner July 20, 2025 13:58
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit f36904e
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/687e816bd4528200086bc169
😎 Deploy Preview https://deploy-preview-2048--kleros-v2-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for kleros-v2-testnet-devtools ready!

Name Link
🔨 Latest commit f36904e
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/687e816bf9543100087d526d
😎 Deploy Preview https://deploy-preview-2048--kleros-v2-testnet-devtools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

coderabbitai bot commented Jul 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The handleNewPeriod function in KlerosCore.ts was updated so that when a vote's choice is null, the associated juror entity is explicitly saved before continuing to the next iteration. The package version in package.json was incremented from 0.17.0 to 0.17.1. No other logic or exported entities were changed.

Changes

File(s) Change Summary
subgraph/core/src/KlerosCore.ts Updated handleNewPeriod to save juror entity when vote choice is null before continuing loop.
subgraph/package.json Incremented package version from 0.17.0 to 0.17.1

Estimated code review effort

1 (~5 minutes)

Suggested labels

Type: Bug :bug:, Package: Subgraph

Poem

A juror’s tale, a vote unclear,
Now saved with care, no need to fear.
Choices null, but data stays,
Persisted well in modern ways.
A gentle tweak, a careful save—
For every bunny coder brave! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 032f38c and f36904e.

📒 Files selected for processing (1)
  • subgraph/package.json (1 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for kleros-v2-university failed. Why did it fail? →

Name Link
🔨 Latest commit f36904e
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-university/deploys/687e816b10425f0008afd91e

kemuru
kemuru previously approved these changes Jul 20, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 20, 2025
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for kleros-v2-neo failed. Why did it fail? →

Name Link
🔨 Latest commit f36904e
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/687e816b900e140008093f45

@jaybuidl jaybuidl force-pushed the fix/leaderboard-juror-count branch from c995b22 to 032f38c Compare July 21, 2025 18:02
@jaybuidl jaybuidl dismissed stale reviews from kemuru and coderabbitai[bot] via f36904e July 21, 2025 18:05
@jaybuidl jaybuidl merged commit f4ed9a0 into dev Jul 21, 2025
5 of 6 checks passed
@jaybuidl jaybuidl deleted the fix/leaderboard-juror-count branch July 21, 2025 18:06
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants