-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Don't increment messageId for custom ping messages #2493
Conversation
WalkthroughThe changes in this pull request focus on enhancing the handling of message IDs within the Changes
Possibly related PRs
Suggested labels
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
🧹 Outside diff range and nitpick comments (1)
indexer/services/socks/src/websocket/index.ts (1)
314-315
: LGTM with suggestion: Incrementing messageId for unsubscribe messagesThis change ensures that each unsubscribe message receives a unique
messageId
. It's correctly placed after callingthis.subscriptions.unsubscribe()
and before sending the unsubscribed message. This modification aligns with the PR objective of improving the handling ofmessageId
.However, to enhance robustness, consider adding a safety check:
Consider adding a safety check before incrementing the
messageId
:+ if (this.connections[connectionId]) { this.connections[connectionId].messageId += 1; + }This will prevent potential errors if the connection is closed between the unsubscribe operation and the message sending.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- indexer/services/socks/src/websocket/index.ts (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
indexer/services/socks/src/websocket/index.ts (2)
283-284
: LGTM: Incrementing messageId for subscription messagesThis change ensures that each subscription message receives a unique
messageId
. It's correctly placed after validating the subscription message and before callingthis.subscriptions.subscribe()
. This modification aligns with the PR objective of improving the handling ofmessageId
.
Line range hint
1-500
: Verify alignment with PR objectivesThe changes implemented improve the handling of
messageId
for subscription and unsubscription messages, which aligns with part of the PR objectives. However, the PR summary mentions a specific change regarding custom ping messages:The primary change introduced in this PR is the modification of the handling of
messageId
for custom ping messages, specifically ensuring that themessageId
is not incremented for these messages.This specific change for custom ping messages is not evident in the current implementation. Could you clarify if this aspect of the PR objective has been addressed elsewhere or if it needs to be implemented?
To verify the handling of custom ping messages, you can run the following script:
This will help identify if the custom ping message handling is implemented elsewhere in the codebase.
@Mergifyio backport release/indexer/v7.x |
@Mergifyio backport release/indexer/v6.x |
✅ Backports have been created
|
✅ Backports have been created
|
(cherry picked from commit 40e16b4)
(cherry picked from commit 40e16b4)
Changelist
don't increment messageId for custom ping messages
Test Plan
[Describe how this PR was tested (if applicable)]
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
Bug Fixes
Chores