- Notifications
You must be signed in to change notification settings - Fork948
fix(site): only attempt to watch containers when agent connected#18873
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Pull Request Overview
This PR prevents the WebSocket connection from being established until the agent is in the "connected" state.
- Guard the
useEffect
to early return whenagent.status
is not "connected" - Add
agent.status
to the effect’s dependency array - Add a unit test to verify no connection is made if the agent is disconnected
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
site/src/modules/resources/useAgentContainers.ts | Early return in effect and updated dependencies |
site/src/modules/resources/useAgentContainers.test.tsx | New test to confirm no socket call on disconnected agent |
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.
👍
089f960
intomainUh oh!
There was an error while loading.Please reload this page.
This PR ensures we do not attempt to call
containers/watch
on the agentbefore it is connected.