mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 08:37:49 +00:00
* fix(runtime): publish remote control diagnostics to renderer * test(runtime): account for diagnostics bridge listener * fix(i18n): add runtime connection state labels * test(runtime): clean up shared control connection * fix(runtime): fence diagnostics by shared-control capability * fix(runtime): preserve authoritative transport state * fix(runtime): preserve diagnostic overlay lifecycle * fix(runtime): avoid publishing unchanged diagnostics state --------- Co-authored-by: Merge Sim <sim@local>
27 lines
873 B
TypeScript
27 lines
873 B
TypeScript
import { BrowserWindow } from 'electron'
|
|
import type { RemoteRuntimeSharedConnectionDiagnostics } from '../../shared/remote-runtime-shared-control-types'
|
|
import { RUNTIME_ENVIRONMENT_DIAGNOSTICS_CHANNEL } from '../../shared/runtime-environment-diagnostics'
|
|
|
|
export { RUNTIME_ENVIRONMENT_DIAGNOSTICS_CHANNEL }
|
|
|
|
export type RuntimeEnvironmentDiagnosticsEvent = {
|
|
environmentId: string
|
|
transportGeneration: number
|
|
diagnostics: RemoteRuntimeSharedConnectionDiagnostics
|
|
}
|
|
|
|
export function publishRuntimeEnvironmentDiagnostics(
|
|
event: RuntimeEnvironmentDiagnosticsEvent
|
|
): void {
|
|
for (const window of BrowserWindow.getAllWindows()) {
|
|
if (window.isDestroyed()) {
|
|
continue
|
|
}
|
|
try {
|
|
window.webContents.send(RUNTIME_ENVIRONMENT_DIAGNOSTICS_CHANNEL, event)
|
|
} catch {
|
|
// A renderer can disappear between isDestroyed() and send().
|
|
}
|
|
}
|
|
}
|