mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
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:
1 parent
58c8a481ed
commit
d86047fe8f
12 files changed
+229
-76
No files matched your search
@@ -195,3 +195,24 @@ test('a Context transition in flight is restored before the globe goes', async (
|
||||
assert.equal(session.context._contextModeGeneration, 5);
|
||||
assert.equal(session.context._contextModeChanging, false);
|
||||
});
|
||||
|
||||
test('an attachment that throws part-way leaves the shell detached and attachable', async () => {
|
||||
const { shell, log } = fakeShell();
|
||||
await shell.detachScene({ handoff: true });
|
||||
shell._initSceneOverlays = () => {
|
||||
throw new Error('overlay host failed');
|
||||
};
|
||||
assert.throws(
|
||||
() => shell.attachScene({ engine: { kind: 'navara' } }),
|
||||
/overlay host failed/,
|
||||
);
|
||||
// The shell releases what it built and is detached when that settles.
|
||||
await shell.detachScene();
|
||||
assert.equal(shell.engine, null);
|
||||
log.length = 0;
|
||||
shell._initSceneOverlays = () => log.push('_initSceneOverlays');
|
||||
const engine = { kind: 'cesium' };
|
||||
shell.attachScene({ engine });
|
||||
assert.equal(shell.engine, engine);
|
||||
assert.ok(log.includes('shareRestoration.start'));
|
||||
});
|
||||
Reference in new issue
Block a user