Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): stop blocking the renderer during topology polling #19300

Mergeddaniyal-sh(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/19300/headmerged by juliusmarminge View on GitHub

Showing 10 changed files with 77 additions and 55 deletions (loading 7).

x
0 of 10 viewed, 10 left
58 additions and 47 deletionsapps/desktop/src/ipc/methods/window.tsModified
View file
@@ -99,57 +99,68 @@
}),
});
​
-export const getLocalEnvironmentBootstraps = DesktopIpc.makeSyncIpcMethod({
- channel: IpcChannels.GET_LOCAL_ENVIRONMENT_BOOTSTRAPS_CHANNEL,
- result: Schema.Array(DesktopEnvironmentBootstrapSchema),
- handler: Effect.fn("desktop.ipc.window.getLocalEnvironmentBootstraps")(function* () {
- const pool = yield* DesktopBackendPool.DesktopBackendPool;
- const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;
- const instances = yield* pool.list;
- const bootstraps: DesktopEnvironmentBootstrap[] = [];
- for (const instance of instances) {
- const isPrimary = instance.id === PRIMARY_LOCAL_ENVIRONMENT_ID;
- const config = yield* instance.currentConfig;
- const snapshot = yield* instance.snapshot;
- if (Option.isNone(config) || Option.isSome(config.value.preflightFailure)) {
- const fatalPreflight =
- Option.isSome(config) &&
- Option.isSome(config.value.preflightFailure) &&
- config.value.preflightFailure.value.fatal;
- const stoppedPreflight =
- Option.isSome(config) &&
- Option.isSome(config.value.preflightFailure) &&
- (!snapshot.desiredRunning || !snapshot.restartScheduled);
- if (isPrimary || fatalPreflight || stoppedPreflight) continue;
- bootstraps.push({
- id: instance.id,
- label: yield* instance.label,
- runningDistro: null,