Release the shell from a candidate engine that fails after it attached

The shell's scene part detaches it too, so a candidate failing in a later part (a layer's drawing, Cockpit clouds) leaves the shell free for the working engine instead of refusing every later attach. StyleManager.attachScene releases what it built when it throws, and one detach runs at a time. The controls phase awaits its parts, and a failed attachment no longer forces handoff off for the parts it releases. scripts/qa-app-once.mjs now also rolls back from a Navara candidate whose layer attachment fails.
This commit is contained in:
German Khokhlov committed 2026-11-03 19:45:34 +04:00
1 parent 58c8a481ed
commit d86047fe8f
12 files changed
+229 -76

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
import { catalogControlServices } from './catalog.js';
/**
* The shell's scene part: the shell was built on `builtOn`, and each later
* globe attaches to it with that globe's catalog. A switch detaches the
* shell in 'shell-release' (the tools phase), before the data layers, as its
* teardown always did; this part's detach covers an attachment that failed
* before that part attached (a later part of a candidate engine) and is a
* no-op once the shell has let go.
*/
export function shellScenePart(styleManager, { builtOn, catalog }) {
let first = builtOn;
return {
name: 'shell',
attachScene(next) {
if (next === first) {
first = null;
return;
}
first = null;
styleManager.attachScene({
viewer: next.viewer,
engine: next.engine,
mapStackController: next.mapStackController,
services: catalogControlServices(next.catalog ?? catalog),
engineSwitch: true,
});
},
detachScene: (options) => styleManager.detachScene(options),
};
}