Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ All notable changes to the Elide extension are documented here. The format follo

- Enable colorized process output for Elide task terminals, including tasks launched from sidebar targets
and Android builds. Preserve color opt-outs and keep failure messages free of ANSI escapes.
- Komodo Compose previews no longer fail with "the preview session closed" after an earlier preview
session was closed or replaced; the next preview starts a new session.

## [0.8.0](https://github.com/elide-dev/vscode/compare/v0.7.0...v0.8.0) (2026-11-03)

Expand Down
14 changes: 6 additions & 8 deletions packages/vscode/src/composeKomodo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,15 +755,13 @@ export class KomodoBackend extends ComposeBackend {
this.spare = reused;
throw new Error(`Komodo: ${this.refusal.reason}`);
}
// Concurrent restarts share one start. It is cleared once settled, from a callback: a body that takes the prepared session
// without awaiting would run its own `finally` before the assignment and leave the session memoized after it closes.
const daemon = reused ?? await (this.starting ??= (async () => {
try {
const started = this.prepared?.alive ? this.prepared : await this.open(sourceFile, signal);
this.prepared = undefined;
return started;
} finally {
this.starting = undefined;
}
})());
const started = this.prepared?.alive ? this.prepared : await this.open(sourceFile, signal);
this.prepared = undefined;
return started;
})().finally(() => { this.starting = undefined; }));
const reason = await this.configureDaemon(daemon, compiled, signal).catch((error: unknown) => {
daemon.dispose();
throw error;
Expand Down
13 changes: 13 additions & 0 deletions packages/vscode/test/composeKomodo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,19 @@ describe("Komodo engine sessions", () => {
expect(daemon.commands("configure")).toHaveLength(1);
});

test("a preflight session closed by a preemption is not configured again", async () => {
const daemon = await fakeDaemon();
const backend = await engine(daemon);
await backend.prepareSession(file);
await backend.preview(request(card));
backend.preempt("another preview took the session");
await backend.prepareSession(file);
const gallery = await backend.preview(request(card));
expect(daemon.connections).toHaveLength(2);
expect(daemon.connections[1]!.commands.filter((command) => command.command === "configure")).toHaveLength(1);
expect(gallery.images.map((image) => image.error)).toEqual([undefined, undefined]);
});

test("preflight reports protocol incompatibility without connecting or configuring a daemon", async () => {
const daemon = await fakeDaemon();
const unavailable: string[] = [];
Expand Down
Loading