-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix(bonsai-core): work around indexer race condition by managing websocket value lifecycles more clearly #1420
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -229,16 +233,15 @@ export function setUpParentSubaccount(store: RootStore) { | |||
if (!isTruthy(wallet) || subaccount == null) { |
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.
lint warnings here?
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.
yeah I like being extra safe with this one even though technically it can't be null
Now we keep all subscriptions open for an extra 20 seconds to prevent churn. Before if you flipped back and forth quickly (sub, unsub, resub) you'd run into weird race conditions and break things. Now when you unsub we hold onto that subscription for 20 seconds and then destroy it. If you re-sub before destruction we just hand you back the sub we kept around.