Skip to content

Commit 794ba07

Browse files
committed
fix: remove unused session store check
1 parent 98b9165 commit 794ba07

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

src/daemon/handlers/__tests__/session.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4521,7 +4521,7 @@ test('open does not retain a session when the request was canceled before comple
45214521
expect(response.error.code).toBe('COMMAND_FAILED');
45224522
expect(response.error.message).toBe('request canceled');
45234523
}
4524-
expect(sessionStore.has('default')).toBe(false);
4524+
expect(sessionStore.get('default')).toBeUndefined();
45254525
} finally {
45264526
clearRequestCanceled(requestId);
45274527
}

src/daemon/handlers/session-open.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,8 @@ export async function handleOpenCommand(params: {
286286
}): Promise<DaemonResponse> {
287287
const { req, sessionName, logPath, sessionStore } = params;
288288

289-
if (sessionStore.has(sessionName)) {
290-
const session = sessionStore.get(sessionName);
291-
if (!session) {
292-
return errorResponse('SESSION_NOT_FOUND', `Session "${sessionName}" not found.`);
293-
}
289+
const session = sessionStore.get(sessionName);
290+
if (session) {
294291
const shouldRelaunch = req.flags?.relaunch === true;
295292
const requestedOpenTarget = req.positionals?.[0];
296293
const openTarget = requestedOpenTarget ?? (shouldRelaunch ? session.appName : undefined);

src/daemon/session-store.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ export class SessionStore {
2121
return this.sessions.get(name);
2222
}
2323

24-
has(name: string): boolean {
25-
return this.sessions.has(name);
26-
}
27-
2824
set(name: string, session: SessionState): void {
2925
this.sessions.set(name, session);
3026
}

0 commit comments

Comments
 (0)