Skip to content

Commit 1f4e120

Browse files
committed
fix: Remove duplicate logs from WorkspaceBuildPage
This removes the list API request. The stream endpoint will always return existing logs, so the additional list returned duplicates!
1 parent 0585372 commit 1f4e120

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

site/src/xServices/workspaceBuild/workspaceBuildXService.ts

+1-19
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ export const workspaceBuildMachine = createMachine(
3333
getWorkspaceBuild: {
3434
data: WorkspaceBuild
3535
}
36-
getLogs: {
37-
data: ProvisionerJobLog[]
38-
}
3936
},
4037
},
4138
tsTypes: {} as import("./workspaceBuildXService.typegen").Typegen0,
@@ -57,18 +54,8 @@ export const workspaceBuildMachine = createMachine(
5754
},
5855
idle: {},
5956
logs: {
60-
initial: "gettingExistentLogs",
57+
initial: "watchingLogs",
6158
states: {
62-
gettingExistentLogs: {
63-
invoke: {
64-
id: "getLogs",
65-
src: "getLogs",
66-
onDone: {
67-
actions: ["assignLogs"],
68-
target: "watchingLogs",
69-
},
70-
},
71-
},
7259
watchingLogs: {
7360
id: "watchingLogs",
7461
invoke: {
@@ -107,10 +94,6 @@ export const workspaceBuildMachine = createMachine(
10794
clearGetBuildError: assign({
10895
getBuildError: (_) => undefined,
10996
}),
110-
// Logs
111-
assignLogs: assign({
112-
logs: (_, event) => event.data,
113-
}),
11497
addLog: assign({
11598
logs: (context, event) => {
11699
const previousLogs = context.logs ?? []
@@ -120,7 +103,6 @@ export const workspaceBuildMachine = createMachine(
120103
},
121104
services: {
122105
getWorkspaceBuild: (ctx) => API.getWorkspaceBuildByNumber(ctx.username, ctx.workspaceName, ctx.buildNumber),
123-
getLogs: async (ctx) => API.getWorkspaceBuildLogs(ctx.buildId),
124106
streamWorkspaceBuildLogs: (ctx) => async (callback) => {
125107
const reader = await API.streamWorkspaceBuildLogs(ctx.buildId)
126108

0 commit comments

Comments
 (0)