fix(renderer-scripts): await the bridge bind and retry it on poll

ipcRenderer.invoke rejects asynchronously, so marking the bridge bound before
awaiting left set-value dead for the session while the log reported success.

Compare installed-app snapshots structurally instead of by an explicit field
list, which had already drifted from the bridge copy and hid location changes.
This commit is contained in:
kitbyte
2026-08-29 16:56:51 +03:00
parent 5d1aa69a97
commit f2e88e9247
8 changed files with 224 additions and 184 deletions
@@ -2,6 +2,7 @@ import { TRAINER_LAUNCH_REQUEST_EXPORT_KEY } from "./constants.js"
import {
findExportedConstructor,
findInstanceInContainerGraph,
formatError,
isRecord,
} from "./runtime.js"
@@ -13,6 +14,15 @@ export function hasMissingOptionalServices(state) {
)
}
export function hasUnresolvedServices(state) {
return (
hasMissingOptionalServices(state) ||
!state.trainerApiService ||
!state.trainerService ||
!state.trainerLaunchRequestCtor
)
}
const OPTIONAL_SERVICE_SPECS = [
{
stateKey: "unavailableTitlesService",
@@ -87,7 +97,7 @@ export function getInstalledAppsService(state, container, webpackRequire) {
state.log(
"warn",
"Failed to resolve installed apps service from Aurelia container.",
error?.stack || String(error)
formatError(error)
)
return null
}
@@ -129,7 +139,7 @@ export function getStoreRef(state, container, webpackRequire) {
state.log(
"warn",
"Failed to resolve Store from container.",
error?.stack || String(error)
formatError(error)
)
return null
}
@@ -216,7 +226,7 @@ function getContainerService(state, container, ctor, warningKey, label) {
state.log(
"warn",
`Failed to resolve ${label.toLowerCase()} from Aurelia container.`,
error?.stack || String(error)
formatError(error)
)
return null
}