Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/pages/admin/PlatformStackView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,9 @@ export function PlatformStackView() {
return () => clearInterval(iv)
}, [settled, load])

// Reconnect the log stream on every status change — each pipeline step is
// its own Job and its own pod, so the previous stream has already ended.
// Reconnect when either the pipeline step or Registry sub-step changes —
// Registry preparation runs several Jobs while status stays step_vtc_setup,
// then the minted DID switches the source back to the VTC setup Job.
const sessionId = stack?.id
useEffect(() => {
if (!sessionId || status === 'failed' || status === 'awaiting_admin_did') return
Expand All @@ -474,7 +475,7 @@ export function PlatformStackView() {
es.addEventListener('done', () => es.close())
es.onerror = () => es.close()
return () => es.close()
}, [sessionId, status, logStreamGeneration])
}, [sessionId, status, stack?.trust_registry?.phase, stack?.trust_registry?.did, logStreamGeneration])

function reconnectVtaLogs() {
setLogs([])
Expand Down
10 changes: 6 additions & 4 deletions src/pages/portal/FullStackCreateProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export function FullStackCreateProgress({ sessionId, vtaName }: { sessionId: str
return () => clearInterval(iv)
}, [sessionId])

// Reconnect the log stream whenever the raw status changes — each step is its own Job/pod.
// Registry preparation runs several Jobs without changing the raw session
// status; its phase selects those Jobs, and its minted DID switches the
// source back to the VTC setup Job.
useEffect(() => {
if (!session || session.status === 'failed' || session.status === 'awaiting_admin_did') return
// Clear when the stream actually opens rather than up front: the previous
Expand All @@ -43,10 +45,10 @@ export function FullStackCreateProgress({ sessionId, vtaName }: { sessionId: str
es.addEventListener('done', () => es.close())
es.onerror = () => es.close()
return () => es.close()
// Keyed on the status, not the object: the 3s poll replaces `session` every
// tick, so depending on it would reconnect this stream continuously.
// Keyed on scalar progress fields, not the object: the 3s poll replaces
// `session` every tick, which would reconnect this stream continuously.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [sessionId, session?.status])
}, [sessionId, session?.status, session?.trust_registry?.phase, session?.trust_registry?.did])

// Scroll only within the console body — not the whole page — as new lines arrive.
useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/portal/SessionDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ function SessionDetailContent() {
es.addEventListener('done', () => es.close())
es.onerror = () => es.close()
return () => es.close()
// Keyed on the status, not the object: the 3s poll replaces `session` every
// tick, so depending on it would reconnect this stream continuously.
// Keyed on scalar progress fields, not the object: the 3s poll replaces
// `session` every tick, which would reconnect this stream continuously.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [sessionId, session?.status, logStreamGeneration])
}, [sessionId, session?.status, session?.trust_registry?.phase, session?.trust_registry?.did, logStreamGeneration])

function reconnectVtaLogs() {
setLogs([])
Expand Down