-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(tabs): keep connection for tabs-[INS-4778] #8266
base: feat/multiple-tab
Are you sure you want to change the base?
Conversation
00aee7b
to
404d75e
Compare
// Close all websocket connections when the active environment changes | ||
useEffect(() => { | ||
return () => { | ||
window.main.webSocket.closeAll(); | ||
window.main.grpc.closeAll(); | ||
}; | ||
}, [activeEnvironment?._id]); |
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.
This a trade-off; Previously, we closed all connections when the active environment changed to avoid users not knowing which URL is currently used to connect if included some env.
Now, based on multiple tabs, we may have multiple WebSocket or grpc tabs from different workspaces, and we want to keep all the connections when the corresponding tab exists. When a workspace's active environment changes, finding which requests are affected and closing them will introduce more complexity.
So I just delete it and only close connection when tab close.
Changes: