Skip to content

fallback to polling for receive-quotes#622

Open
gudnuf wants to merge 1 commit intomasterfrom
fallback-to-polling
Open

fallback to polling for receive-quotes#622
gudnuf wants to merge 1 commit intomasterfrom
fallback-to-polling

Conversation

@gudnuf
Copy link
Contributor

@gudnuf gudnuf commented Sep 8, 2025

One piece of #577

If we are rate limited and do not already have a connection to the mint open, then the call to subscribe will simply fail with no useful error. If the call to subscribe fails 2x, then we will fallback to polling which seems to have a different rate limit bucket from sockets. This is also useful because sometimes we aren't rate limited, but just fail to connect to the socket (see discord)

If we are also rate limited on the check mint quote endpoint, then our retry function will wait 1 minute (already implemented).

If you like this approach @jbojcic1 , then I will implement polling fallbacks for proofs states and melt quotes

@gudnuf gudnuf requested a review from jbojcic1 September 8, 2025 22:25
@gudnuf gudnuf self-assigned this Sep 8, 2025
@supabase
Copy link

supabase bot commented Sep 8, 2025

This pull request has been ignored for the connected project hrebgkfhjpkbxpztqqke because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel
Copy link

vercel bot commented Sep 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
agicash Ready Ready Preview Comment Sep 10, 2025 3:11pm

@jbojcic1
Copy link
Collaborator

jbojcic1 commented Sep 9, 2025

then we will fallback to polling which seems to have a different rate limit bucket from sockets

don't think this is true (at least don't think it was). see https://discord.com/channels/1189257044264501288/1374083927936860190/1374772662311587940

};
}, [quotesByMint, excludedMints]);

useTrackMintQuotesWithPolling({
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't think this is the right way to implement this. useTrackMintQuotesWithWebSocket shouldn't be falling back to polling. instead we should let the caller of this hook do the orchestration of what should be polled and what should be subscribed to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

alright I updated it

@gudnuf gudnuf force-pushed the fallback-to-polling branch from fa19715 to db8d49f Compare September 10, 2025 15:10
@gudnuf gudnuf linked an issue Oct 9, 2025 that may be closed by this pull request
@gudnuf gudnuf added the P3 nice to have eventually label Oct 9, 2025
@jbojcic1
Copy link
Collaborator

then we will fallback to polling which seems to have a different rate limit bucket from sockets

don't think this is true (at least don't think it was). see https://discord.com/channels/1189257044264501288/1374083927936860190/1374772662311587940

can you please check this? we need to make sure your assumption is correct before going with this approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 nice to have eventually

Projects

None yet

Development

Successfully merging this pull request may close these issues.

handle web socket rate limit error

2 participants