Skip to content

fix: clear the connection error once polling recovers - #73

Open
charan-rathore wants to merge 1 commit into
CopilotKit:mainfrom
charan-rathore:fix/clear-recovered-connection-error
Open

charan-rathore wants to merge 1 commit into
CopilotKit:mainfrom
charan-rathore:fix/clear-recovered-connection-error

Conversation

@charan-rathore

Copy link
Copy Markdown

Fixes #51

After the API restarted, the red connection banner stayed up because nothing cleared it on a later successful poll.

Connection notices (failed fetch, 502/504, unreadable response) are now tracked separately from action errors. A successful workspace or capture poll clears only the connection notice. Action errors still need a dismiss, and 401 handling is unchanged. The logic is in src/client/poll-notice.ts with unit tests.

Checked locally on current main (c2569bb): npx vitest run (36 files, 168 tests), tsc --noEmit, eslint and prettier all pass. The tests cover the notice logic only. I did not exercise the banner in a browser against a restarted API, and did not run npm run build.

A successful workspace or capture poll now clears only the connection
notice, so a recovered server no longer leaves the error banner up.
Errors from user actions are kept apart and still need a dismiss.

Fixes CopilotKit#51
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.

Error banner stays after the server connection recovers

1 participant