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
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ test('keeps equal raw Session ids distinct across Runtime Hosts', () => {
);

assert.notEqual(local.id, remote.id);
assert.equal(local.revision, 7);
assert.equal(remote.revision, 7);
assert.equal(local.profileKind, 'local');
assert.equal(remote.profileName, 'Office');
});
Expand Down Expand Up @@ -268,9 +270,10 @@ test('projects durable WorkHub delegation targets into the Desktop host namespac
}
});

function summary(id: string): SessionSummary {
function summary(id: string): SessionSummary & { revision: number } {
return {
id,
revision: 7,
name: id,
isFlagged: false,
isArchived: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ test('projects imported Session ids into the same Desktop identity space as Sess
assert.equal(catalogItem.importState.importedSessionIds[0], summary.id);
});

function session(id: string): SessionSummary {
function session(id: string): SessionSummary & { revision: number } {
return {
id,
revision: 1,
name: 'Imported',
isFlagged: false,
isArchived: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import type { IpcMain } from 'electron';
import type { SessionCatalogProjection, SessionCreateInput } from '@maka/runtime-host/protocol';
import {
registerRuntimeHostSessionCatalogIpc,
toDesktopHostSharedSessionSummary,
toDesktopHostSessionSummary,
type RuntimeHostSessionCatalogIpcDeps,
} from '../runtime-host-session-catalog-ipc-main.js';
Expand All @@ -41,6 +42,11 @@ test('maps Runtime Host live run state without collapsing unknown and known-empt
assert.deepEqual(running.runningTurnIds, ['turn-live']);
});

test('preserves the Session revision in Owner and Shared Desktop Host summaries', () => {
assert.equal(toDesktopHostSessionSummary(projection({ revision: 7 })).revision, 7);
assert.equal(toDesktopHostSharedSessionSummary(sharedProjection()).revision, 7);
});

test('session creation forwards the caller name for a mode that carries none', async () => {
const creates: SessionCreateInput[] = [];
const ipc = ipcHarness();
Expand Down Expand Up @@ -121,3 +127,15 @@ function projection(overrides: Partial<SessionCatalogProjection> = {}): SessionC
...overrides,
};
}

function sharedProjection() {
return {
kind: 'shared_session' as const,
id: 'session-1',
revision: 7,
createdAt: 1,
activityAt: 2,
name: 'Session',
status: 'active' as const,
};
}
Loading