Skip to content

Commit 7ddce4a

Browse files
committed
fix(session): satisfy oxlint no-empty-function and oxfmt after rebase
1 parent 261daac commit 7ddce4a

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎src/session/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export async function initSessionDir(
181181
await symlink(sessionId, tmpPath);
182182
await rename(tmpPath, linkPath);
183183
} catch (err: unknown) {
184-
await unlink(tmpPath).catch(() => {});
184+
await unlink(tmpPath).catch(() => undefined);
185185
throw err;
186186
}
187187
} catch (err: unknown) {

‎src/session/session-dir.test.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { afterEach, beforeEach, expect, test } from "bun:test";
2-
import { mkdir, readFile, readdir, readlink, rm, writeFile } from "node:fs/promises";
2+
import {
3+
mkdir,
4+
readFile,
5+
readdir,
6+
readlink,
7+
rm,
8+
writeFile,
9+
} from "node:fs/promises";
310
import { existsSync } from "node:fs";
411
import { dirname, join } from "node:path";
512
import { tmpdir } from "node:os";
@@ -84,7 +91,9 @@ test("listSessions finds legacy sessions and migrates them", async () => {
8491

8592
test("concurrent initSessionDir does not throw on latest symlink race", async () => {
8693
const ids = Array.from({ length: 16 }, () => generateSessionId());
87-
const dirs = await Promise.all(ids.map((id) => initSessionDir(cwd, id, home)));
94+
const dirs = await Promise.all(
95+
ids.map((id) => initSessionDir(cwd, id, home)),
96+
);
8897
for (const [i, dir] of dirs.entries()) {
8998
expect(dir).toBe(sessionDir(cwd, ids[i] as string, home));
9099
expect(existsSync(join(dir, "context"))).toBe(true);

0 commit comments

Comments
 (0)