Skip to content

Conversation

@ali-behjati
Copy link
Collaborator

No description provided.

@ali-behjati ali-behjati requested review from Reisen and m30m December 5, 2023 15:55
@vercel
Copy link

vercel bot commented Dec 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Visit Preview Dec 7, 2023 6:20pm
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Dec 7, 2023 6:20pm

// close the connection.
self.sender
.send(
serde_json::to_string(&ServerResponseMessage::Err {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just ignore the removed feeds? In the current solution, when a price feed is removed, all websocket connections need to be opened up again and we will miss a few slots in between.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's a fair point and I have changed the code to follow what you says. However I think it is an unintuitive business logic and might surprise consumers. I wouldn't do it if our data ingestion wasn't relying on this.

The better approach would be what you had suggested before, a subscribeToAll method (or a *) and it is intuitive for a subscription to all to keep the connection while a feed is removed. However I didn't do it because it is a big change and we are going to move away from this API soon.


for key in keys_in_cache {
if !current_keys.contains(&key) {
message_cache.remove(&key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is not very often, it would be great if we add some log here to see it in action once live.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a info log level for it.

@ali-behjati ali-behjati force-pushed the hermes/fix-issue-on-price-removal branch from 056c4f2 to 988e112 Compare December 7, 2023 17:58
@ali-behjati ali-behjati force-pushed the hermes/fix-issue-on-price-removal branch from 988e112 to 5c85f97 Compare December 7, 2023 18:20
@ali-behjati ali-behjati merged commit 93e9c49 into main Dec 7, 2023
@ali-behjati ali-behjati deleted the hermes/fix-issue-on-price-removal branch December 7, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants