From 7a5576a4a88bdca9129ac79e86d67f09753e8221 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Mon, 27 Jul 2026 09:02:50 +0800 Subject: [PATCH] style: reshape the fixture session guard under max-len and indent rules --- .../client/connection/src/client/fixture.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/client/connection/src/client/fixture.ts b/packages/client/connection/src/client/fixture.ts index 087de2333a..eaab0a43f9 100644 --- a/packages/client/connection/src/client/fixture.ts +++ b/packages/client/connection/src/client/fixture.ts @@ -428,15 +428,16 @@ export function createFixtureApi(options: FixtureOptions = {}): ApiProxy { } const summaryOf = (id: SessionId): SessionSummary | undefined => sessions.find(s => s.sessionId === id) - /** Shared session guard for sessionId-addressed catalog routes: the error response when the session is unknown, undefined when it exists. */ - const requireSession = (request: RpcRequest<{ sessionId: SessionId }>): Promise> | undefined => - summaryOf(request.payload.sessionId) === undefined - ? err<{ sessionId: SessionId }, never>(request, { - code: 'session-not-found', - message: `no session ${request.payload.sessionId}`, - details: { sessionId: request.payload.sessionId }, - }) - : undefined + /** Shared session guard for sessionId-addressed catalog routes: the error + * response when the session is unknown, undefined when it exists. */ + const requireSession = (request: RpcRequest<{ sessionId: SessionId }>): Promise> | undefined => { + if (summaryOf(request.payload.sessionId) !== undefined) return undefined + return err<{ sessionId: SessionId }, never>(request, { + code: 'session-not-found', + message: `no session ${request.payload.sessionId}`, + details: { sessionId: request.payload.sessionId }, + }) + } const setRunning = (id: SessionId, running: boolean): void => { const summary = summaryOf(id) if (summary === undefined || summary.running === running) return