Skip to content

Commit 5ae5b5a

Browse files
committed
Add changelog + smol refactoring
..
1 parent 6739540 commit 5ae5b5a

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
@@ -5,10 +5,14 @@
55
### Changed
66

77
- Always enable verbose (`-v`) flag when a log directory is configured (`coder.proxyLogDir`).
8+
- Replaced SSE paths with a one-way WebSocket and centralized creation on `OneWayWebSocket`, and unified socket handling.
89

910
### Added
1011

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

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

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.");
@@ -633,7 +631,7 @@ export class Commands {
633631
{
634632
useCustom: true,
635633
modal: true,
636-
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.`,
634+
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.`,
637635
},
638636
"Update",
639637
"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";
@@ -72,7 +72,7 @@ export class Remote {
7272
binPath: string,
7373
featureSet: FeatureSet,
7474
): Promise<Workspace | undefined> {
75-
const workspaceName = `${workspace.owner_name}/${workspace.name}`;
75+
const workspaceName = createWorkspaceIdentifier(workspace);
7676

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

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)