Keep the debug handle off window between engines and recover the page after a failed recovery

The application's debug handle is one object, present on window only while a globe is attached, so scripts reading __godsEyeView?.engine.kind see no null engine mid-switch. A detached application has no live components: settle no longer waits for a frame of a missing engine, and an engine that runs again after a failed recovery hides the loading screen the error showed.
This commit is contained in:
German Khokhlov committed 2026-11-03 19:10:47 +04:00
1 parent a99b862580
commit 8e1a3bab3e
3 files changed
+104 -6

No files matched your search

+6 -2
View File
@@ -162,7 +162,8 @@ export async function createApplicationTools({
{ defer },
);
// The application's debug handle; its globe fields follow the engine.
// The application's debug handle, the same object on every globe; its
// globe fields follow the engine.
const debug = {
viewer: null,
engine: null,
@@ -179,7 +180,6 @@ export async function createApplicationTools({
surfaceServices: operations.surface,
requestRender: governorRequestRender,
};
window.__godsEyeView = debug;
defer(() => {
if (window.__godsEyeView === debug) delete window.__godsEyeView;
});
@@ -232,8 +232,12 @@ export async function createApplicationTools({
cockpitCloudEffects: controls.cockpitCloudEffects ?? null,
voiceCommands: attached.voiceCommands,
});
// Present only while a globe is attached, as when every engine
// built its own application: scripts read `engine.kind` from it.
window.__godsEyeView = debug;
},
detachScene() {
if (window.__godsEyeView === debug) delete window.__godsEyeView;
Object.assign(debug, {
viewer: null,
engine: null,