Conversation
📝 WalkthroughWalkthroughThis PR migrates the Korbit WebSocket integration from a v1 user push endpoint to a v2 public endpoint. The subscription payload structure, message format, ticker fields, and utility functions are updated to align with the new API specification. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can use your project's `golangci-lint` configuration to improve the quality of Go code reviews.Add a configuration file to your project to customize how CodeRabbit runs |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
node/pkg/websocketfetcher/tests/utils_test.go (1)
207-245: LGTM - Test updated for v2 schema.The test correctly validates the new Korbit v2 message structure, checking:
- Top-level fields:
Type,Symbol,Timestamp- Nested data fields:
Close,VolumeConsider adding test cases for control messages (with
"status"field) and invalid symbol formats to improve coverage, though this is optional.,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@node/pkg/websocketfetcher/tests/utils_test.go` around lines 207 - 245, Test covers Korbit v2 message structure but reviewer suggested adding optional coverage for control messages and invalid symbols; add two small subtests that reuse common.MessageToStruct[korbit.Raw]: one that passes a control-message JSON with a top-level "status" field and validates the parsed struct (e.g., Status or control-related fields exist) and one that passes an invalid symbol format to verify MessageToStruct returns an error (or appropriate handling) for korbit.Raw; locate test "TestMessageToStructKorbit" and add these subtests alongside it, referencing common.MessageToStruct and the korbit.Raw type so the new cases exercise control-message parsing and symbol validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@node/pkg/websocketfetcher/tests/utils_test.go`:
- Around line 207-245: Test covers Korbit v2 message structure but reviewer
suggested adding optional coverage for control messages and invalid symbols; add
two small subtests that reuse common.MessageToStruct[korbit.Raw]: one that
passes a control-message JSON with a top-level "status" field and validates the
parsed struct (e.g., Status or control-related fields exist) and one that passes
an invalid symbol format to verify MessageToStruct returns an error (or
appropriate handling) for korbit.Raw; locate test "TestMessageToStructKorbit"
and add these subtests alongside it, referencing common.MessageToStruct and the
korbit.Raw type so the new cases exercise control-message parsing and symbol
validation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 1d0fea8b-8a3d-4f7c-a30e-6c0d274ce1a4
📒 Files selected for processing (4)
node/pkg/websocketfetcher/providers/korbit/korbit.gonode/pkg/websocketfetcher/providers/korbit/type.gonode/pkg/websocketfetcher/providers/korbit/utils.gonode/pkg/websocketfetcher/tests/utils_test.go
Description
Please include a summary of the changes and the related issue.
Please also include relevant motivation and context.
List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Deployment