-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hanging "Prebuild in Progress" page #10357
Conversation
d9a335d
to
db5409f
Compare
ff53f1c
to
1887fec
Compare
1887fec
to
5a6250c
Compare
} | ||
return false; | ||
}; | ||
const pollIsPrebuildDone = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was unused at all 🙈
const disposables = watchHeadlessLogs( | ||
props.runningPrebuild.instanceID, | ||
(chunk) => logsEmitter.emit("logs", chunk), | ||
checkIsPrebuildDone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was the only option to proceed, i.e. only if headless logs poller checked for isPrebuildDone
periodically, we'd a chance to proceed. whenever that poller broke, this was a UX dead-end.
if (update.workspaceId !== props.runningPrebuild.workspaceID) { | ||
return; | ||
} | ||
if (update.status.phase === "stopped") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the old assumption in a new shape 😞
'still don't like it myself, but it kind of works.
what it does: when we enter the RunningPrebuildView
scene, we're listening for the stopped
event of image-build/prebuild, and when it's happening we proceed.
@@ -661,19 +663,20 @@ interface ImageBuildViewProps { | |||
} | |||
|
|||
function ImageBuildView(props: ImageBuildViewProps) { | |||
const logsEmitter = new EventEmitter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the parent comp of ImageBuildView
decided to re-render this will be reinitialized unintentionally.
@@ -754,7 +754,9 @@ export interface PrebuiltWorkspace { | |||
|
|||
export namespace PrebuiltWorkspace { | |||
export function isDone(pws: PrebuiltWorkspace) { | |||
return pws.state === "available" || pws.state === "timeout" || pws.state === "aborted"; | |||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though isDone
seems to be very unused after this PR, it seems to be wrong to have the failed
state missing in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's unused, let's remove it. It's always available in git history.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's API though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's API though.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @AlexTugarev , worked as expected for me! 🚀
One downside: Logs did not work for me in one case, though, even after reload.
Meanwhile the prebuild view worked flawlessly... 🙈
Bumps the importance respective issue I guess!
@geropl, as mentioned before, image build logs never show up in this. I don't think this is a front-end issue, as I've seen the calls were not successful on server side. There is another issue with image build logs for prebuild which is independent of frontend bits. |
This PR fixes an issue with the hanging "Prebuild in Progress" page.
This PR does not fix missing image builder logs from this very page.
How to test
Fixes #8195 and more.