Skip to content

Commit c2a79b8

Browse files
Mark client as disconnected on connection close/error
Instead of leaving onClose/onError as no-ops (which would leave the client in a stale 'connected' state), transition to 'disconnected' so callers fail fast or can re-start cleanly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d1d733c commit c2a79b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

nodejs/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,11 +1410,11 @@ export class CopilotClient {
14101410
);
14111411

14121412
this.connection.onClose(() => {
1413-
// no-op
1413+
this.state = "disconnected";
14141414
});
14151415

14161416
this.connection.onError((_error) => {
1417-
// no-op
1417+
this.state = "disconnected";
14181418
});
14191419
}
14201420

0 commit comments

Comments
 (0)