Skip to content

Commit 6e29413

Browse files
committed
Add changelog + smol refactoring
..
1 parent b69f187 commit 6e29413

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66

77
- Always enable verbose (`-v`) flag when a log directory is configured (`coder.proxyLogDir`).
88
- Automatically start a workspace without prompting if it is explicitly opened but not running.
9+
- Replaced SSE paths with a one-way WebSocket and centralized creation on `OneWayWebSocket`, and unified socket handling.
910

1011
### Added
1112

1213
- Add support for CLI global flag configurations through the `coder.globalFlags` setting.
14+
- Add logging for all REST and some WebSocket traffic, with REST verbosity configurable via `coder.httpClientLogLevel` (`none`, `basic`, `headers`, `body`).
15+
- An Axios interceptor that tags each request with a UUID to correlate with its response and measure duration.
16+
- Lifecycle logs for WebSocket creation, errors, and closures.
1317

1418
## [1.10.1](https://github.com/coder/vscode-coder/releases/tag/v1.10.1) 2025-08-13
1519

src/commands.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from "coder/site/src/api/typesGenerated";
88
import path from "node:path";
99
import * as vscode from "vscode";
10-
import { extractAgents } from "./api/api-helper";
10+
import { createWorkspaceIdentifier, extractAgents } from "./api/api-helper";
1111
import { needToken } from "./api/auth";
1212
import { CodeApi } from "./api/codeApi";
1313
import { CertificateError } from "./error";
@@ -401,14 +401,13 @@ export class Commands {
401401
*/
402402
public async navigateToWorkspace(item: OpenableTreeItem) {
403403
if (item) {
404-
const uri =
405-
this.storage.getUrl() +
406-
`/@${item.workspace.owner_name}/${item.workspace.name}`;
404+
const workspaceId = createWorkspaceIdentifier(item.workspace);
405+
const uri = this.storage.getUrl() + `/@${workspaceId}`;
407406
await vscode.commands.executeCommand("vscode.open", uri);
408407
} else if (this.workspace && this.workspaceRestClient) {
409408
const baseUrl =
410409
this.workspaceRestClient.getAxiosInstance().defaults.baseURL;
411-
const uri = `${baseUrl}/@${this.workspace.owner_name}/${this.workspace.name}`;
410+
const uri = `${baseUrl}/@${createWorkspaceIdentifier(this.workspace)}`;
412411
await vscode.commands.executeCommand("vscode.open", uri);
413412
} else {
414413
vscode.window.showInformationMessage("No workspace found.");
@@ -425,14 +424,13 @@ export class Commands {
425424
*/
426425
public async navigateToWorkspaceSettings(item: OpenableTreeItem) {
427426
if (item) {
428-
const uri =
429-
this.storage.getUrl() +
430-
`/@${item.workspace.owner_name}/${item.workspace.name}/settings`;
427+
const workspaceId = createWorkspaceIdentifier(item.workspace);
428+
const uri = this.storage.getUrl() + `/@${workspaceId}/settings`;
431429
await vscode.commands.executeCommand("vscode.open", uri);
432430
} else if (this.workspace && this.workspaceRestClient) {
433431
const baseUrl =
434432
this.workspaceRestClient.getAxiosInstance().defaults.baseURL;
435-
const uri = `${baseUrl}/@${this.workspace.owner_name}/${this.workspace.name}/settings`;
433+
const uri = `${baseUrl}/@${createWorkspaceIdentifier(this.workspace)}/settings`;
436434
await vscode.commands.executeCommand("vscode.open", uri);
437435
} else {
438436
vscode.window.showInformationMessage("No workspace found.");
@@ -673,7 +671,7 @@ export class Commands {
673671
{
674672
useCustom: true,
675673
modal: true,
676-
detail: `Update ${this.workspace.owner_name}/${this.workspace.name} to the latest version?\n\nUpdating will restart your workspace which stops any running processes and may result in the loss of unsaved work.`,
674+
detail: `Update ${createWorkspaceIdentifier(this.workspace)} to the latest version?\n\nUpdating will restart your workspace which stops any running processes and may result in the loss of unsaved work.`,
677675
},
678676
"Update",
679677
"Cancel",

src/remote.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
formatEventLabel,
1616
formatMetadataError,
1717
} from "./agentMetadataHelper";
18-
import { extractAgents } from "./api/api-helper";
18+
import { createWorkspaceIdentifier, extractAgents } from "./api/api-helper";
1919
import { needToken } from "./api/auth";
2020
import { CodeApi } from "./api/codeApi";
2121
import { startWorkspaceIfStoppedOrFailed, waitForBuild } from "./api/workspace";
@@ -73,7 +73,7 @@ export class Remote {
7373
featureSet: FeatureSet,
7474
firstConnect: boolean,
7575
): Promise<Workspace | undefined> {
76-
const workspaceName = `${workspace.owner_name}/${workspace.name}`;
76+
const workspaceName = createWorkspaceIdentifier(workspace);
7777

7878
// A terminal will be used to stream the build, if one is necessary.
7979
let writeEmitter: undefined | vscode.EventEmitter<string>;
@@ -119,12 +119,11 @@ export class Remote {
119119
switch (workspace.latest_build.status) {
120120
case "pending":
121121
case "starting":
122-
case "stopping": {
122+
case "stopping":
123123
writeEmitter = initWriteEmitterAndTerminal();
124124
this.storage.output.info(`Waiting for ${workspaceName}...`);
125125
workspace = await waitForBuild(client, writeEmitter, workspace);
126126
break;
127-
}
128127
case "stopped":
129128
if (
130129
!firstConnect &&

src/workspaceMonitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ServerSentEvent, Workspace } from "coder/site/src/api/typesGenerated";
22
import { formatDistanceToNowStrict } from "date-fns";
33
import * as vscode from "vscode";
4-
import { errToStr } from "./api/api-helper";
4+
import { createWorkspaceIdentifier, errToStr } from "./api/api-helper";
55
import { CodeApi } from "./api/codeApi";
66
import { Storage } from "./storage";
77
import { OneWayWebSocket } from "./websocket/oneWayWebSocket";
@@ -38,7 +38,7 @@ export class WorkspaceMonitor implements vscode.Disposable {
3838
// We use the proposed API to get access to useCustom in dialogs.
3939
private readonly vscodeProposed: typeof vscode,
4040
) {
41-
this.name = `${workspace.owner_name}/${workspace.name}`;
41+
this.name = createWorkspaceIdentifier(workspace);
4242
const socket = this.client.watchWorkspace(workspace);
4343

4444
socket.addEventListener("open", () => {

0 commit comments

Comments
 (0)