Skip to content

Commit a4562db

Browse files
fix(explorer): support async sessionCwdOf for fs-events attach
1 parent f064799 commit a4562db

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,20 +1513,20 @@ async function attachAgentList(
15131513
}
15141514

15151515
/** Subscribe an explorer socket to host fs.watch notifications for its cwd. */
1516-
function attachFsEvents(
1516+
async function attachFsEvents(
15171517
ctx: Context,
15181518
hub: FsWatchHub,
15191519
ws: WebSocket,
15201520
req: SidebarHttpRequest,
1521-
): void {
1521+
): Promise<void> {
15221522
try {
15231523
const url = new URL(req.url ?? '/', 'http://dsh.internal')
15241524
const sessionId = url.searchParams.get('sessionId')
15251525
if (sessionId === null) {
15261526
ws.close(1008, 'sessionId is required')
15271527
return
15281528
}
1529-
const cwd = sessionCwdOf(ctx, sessionId, url.searchParams.get('cwd') ?? undefined)
1529+
const cwd = await sessionCwdOf(ctx, sessionId, url.searchParams.get('cwd') ?? undefined)
15301530
ws.on('message', (data) => {
15311531
try {
15321532
const msg = JSON.parse(String(data)) as { type?: unknown; path?: unknown }

0 commit comments

Comments
 (0)