Skip to content

Conversation

@shotaronowhere
Copy link
Contributor

@shotaronowhere shotaronowhere commented Oct 18, 2023

This PR adds features to the subgraph to support polling notification systems.

  • ipfs feature fetches court information (name, description, required skills)
  • voteID key in the Round entity is renamed to voteIDNum to avoid a collision with the graphql-codegen package which generates types for graph queries.

PR-Codex overview

This PR focuses on adding new functionality related to court jumps and period index counters.

Detailed summary

  • Added user.rounds array to User entity in User.ts
  • Removed classicDispute.jumped property in ClassicDispute.ts
  • Added handleCourtJump event handler in subgraph.yaml
  • Added getAndIncrementPeriodCounter function in PeriodIndexCounter.ts
  • Updated useClassicAppealQuery and useDrawQuery hooks in useClassicAppealQuery.ts and useDrawQuery.ts
  • Added getLocalRounds function in getLocalRounds.ts
  • Updated code in DisputeCard/index.tsx, useClassicAppealContext.tsx, Overview.tsx, Voting/index.tsx, CaseDetails/VotingHistory.tsx, and KlerosCore.ts
  • Added handleCourtJump event handler in KlerosCore.ts

The following files were skipped due to too many changes: subgraph/src/KlerosCore.ts, web/src/components/Verdict/DisputeTimeline.tsx, subgraph/schema.graphql

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

@netlify
Copy link

netlify bot commented Oct 18, 2023

Deploy Preview for kleros-v2 failed.

Name Link
🔨 Latest commit 7cce1c7
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/653147de6d34e00008f3db2b
@jaybuidl jaybuidl requested a review from alcercu October 18, 2023 18:32
@shotaronowhere
Copy link
Contributor Author

note, I removed jump from the classicDisputeKit entity.

We can put it back, but the jump property was never properly updated.

I tried to properly update the jump property, but the potential solutions seem complicated. In fact, the jump property should be abstracted into the DisputeKitDispute interface.

From the perspective of the Dispute entity (core dispute), it tracks DisputeKitDisputes, but, since each ClassicDispute extends the DisputeKitDispute interface, we cannot load a generic DisputeKitDispute entity from a core dispute id. A solution would be to use a switch case loader utility function to handle each entity type for new dispute kits. This appeared to be too much complexity so I just removed the field "jump" for now. If the frontend is relying on this parameter, we can put it back, but it was hardcoded as "false".

alcercu
alcercu previously approved these changes Oct 19, 2023
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 7cce1c7 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2
Style 1

View more on Code Climate.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jaybuidl jaybuidl merged commit 7cce1c7 into dev Oct 19, 2023
@jaybuidl jaybuidl added this to the testnet-2 milestone Oct 20, 2023
@jaybuidl jaybuidl deleted the subgraph-notification branch January 3, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants