-
Notifications
You must be signed in to change notification settings - Fork 115
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
[CT-1338] Add channel and id properties to error message on subscription failure. #2678
Conversation
WalkthroughThe pull request introduces enhancements to error messaging in the WebSocket subscription system. Changes are focused on adding optional Changes
Sequence DiagramsequenceDiagram
participant Client
participant WebSocket
participant SubscriptionHandler
participant ErrorMessageGenerator
Client->>WebSocket: Initiate Subscription
WebSocket->>SubscriptionHandler: Subscribe Request
alt Subscription Fails
SubscriptionHandler->>ErrorMessageGenerator: Create Error Message
ErrorMessageGenerator-->>SubscriptionHandler: Error Message with Channel & ID
SubscriptionHandler->>Client: Send Detailed Error Message
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
indexer/services/socks/src/lib/subscription.ts (1)
175-176
: Consider consistent usage of channel and id properties.While the implementation is correct, there's an inconsistency in how the new properties are used. The first
createErrorMessage
call in the file (for invalid subscription) doesn't include these properties, while this one does. Consider adding them consistently across all error messages for better debugging capabilities.- createErrorMessage( - `Invalid subscription id for channel: (${channel}-${id})`, - connectionId, - messageId, - ), + createErrorMessage( + `Invalid subscription id for channel: (${channel}-${id})`, + connectionId, + messageId, + channel, + id, + ),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
indexer/services/socks/__tests__/lib/subscriptions.test.ts
(2 hunks)indexer/services/socks/src/helpers/message.ts
(1 hunks)indexer/services/socks/src/lib/subscription.ts
(1 hunks)indexer/services/socks/src/types.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (13)
- GitHub Check: call-build-ecs-service-vulcan / (vulcan) Check docker image build
- GitHub Check: call-build-ecs-service-socks / (socks) Check docker image build
- GitHub Check: call-build-ecs-service-roundtable / (roundtable) Check docker image build
- GitHub Check: call-build-ecs-service-ender / (ender) Check docker image build
- GitHub Check: call-build-ecs-service-comlink / (comlink) Check docker image build
- GitHub Check: check-build-auxo
- GitHub Check: test / run_command
- GitHub Check: check-build-bazooka
- GitHub Check: lint
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
- GitHub Check: run_command
- GitHub Check: Summary
🔇 Additional comments (3)
indexer/services/socks/src/helpers/message.ts (1)
16-17
: LGTM! Clean implementation of error message enhancement.The addition of optional
channel
andid
parameters tocreateErrorMessage
and their inclusion in the return object is well-implemented and aligns with the PR objective.Also applies to: 24-25
indexer/services/socks/src/types.ts (1)
70-71
: LGTM! Type definitions properly updated.The ErrorMessage interface is correctly updated with the new optional properties, maintaining type safety for the enhanced error messages.
indexer/services/socks/__tests__/lib/subscriptions.test.ts (1)
247-248
: LGTM! Test coverage properly updated.The test cases have been appropriately updated to verify the new error message properties, ensuring the changes are properly tested.
Also applies to: 283-284
@Mergifyio backport release/indexer/v7.x |
✅ Backports have been created
|
Changelist
Add channel and id to error messages returned when subscribing to a channel fails so clients can correctly retry the subscription.
Test Plan
Unit tests.
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
Bug Fixes
Refactor