Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite1da2b6

Browse files
authored
fix: Don't fetch resources when a workspace is building (#3424)
Fixes#3423.
1 parentc0cc8b9 commite1da2b6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

‎site/src/testHelpers/entities.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export const MockProvisionerJob: TypesGen.ProvisionerJob = {
8181
id:"test-provisioner-job",
8282
status:"succeeded",
8383
storage_source:"asdf",
84+
completed_at:"2022-05-17T17:39:01.382927298Z",
8485
}
8586

8687
exportconstMockFailedProvisionerJob:TypesGen.ProvisionerJob={

‎site/src/xServices/workspace/workspaceXService.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,13 @@ export const workspaceMachine = createMachine(
550550
}
551551
},
552552
getResources:async(context)=>{
553-
if(context.workspace){
554-
constresources=awaitAPI.getWorkspaceResources(context.workspace.latest_build.id)
555-
returnresources
556-
}else{
557-
throwError("Cannot fetch workspace resources without workspace")
553+
// If the job hasn't completed, fetching resources will result
554+
// in an unfriendly error for the user.
555+
if(!context.workspace?.latest_build.job.completed_at){
556+
return[]
558557
}
558+
constresources=awaitAPI.getWorkspaceResources(context.workspace.latest_build.id)
559+
returnresources
559560
},
560561
getBuilds:async(context)=>{
561562
if(context.workspace){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp