-
Notifications
You must be signed in to change notification settings - Fork 308
feat(hermes-server) Add ignore_invalid_price_ids flag to hermes ws endpoint
#2599
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 6 Skipped Deployments
|
merolish
left a comment
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.
Are there any corresponding docs that need to be updated?
| return Ok(()); | ||
| } else { | ||
| for price_id in price_ids { | ||
| for price_id in found_price_ids { |
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.
Probably not worth warn logging any not found ids, I assume.
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.
probably not a warn for us, but maybe an warn message to the client would be good (as an error response). not necessary though.
@merolish The WS endpoint is undocumented since we want the public to use the SSE endpoint instead. And that one already supports this flag. |
Summary
Add a new flag
ignore_invalid_price_idsto WebSocket subscriptions that enables partial subscriptions when some price IDs are invalid. When enabled, Hermes will establish the WebSocket connection and stream updates only for the valid price IDs while silently ignoring any invalid ones. This enhancement aligns the WebSocket API behaviour with the existing REST API functionality introduced in #2091.Rationale
This change simplifies integration for clients who need to subscribe to multiple price feeds but don't require all of them to be valid. Current workarounds are suboptimal:
The new flag provides a more efficient solution by allowing clients to subscribe to all desired price feeds in a single request while gracefully handling any invalid IDs. This reduces implementation complexity for clients and improves connection efficiency by eliminating the need for multiple subscription attempts or error handling logic.
How has this been tested?