fix: cancel session authorization reads

This commit is contained in:
Hypatia May
2026-07-24 19:21:32 +08:00
parent 415948dd7b
commit 795af3174e
10 changed files with 250 additions and 19 deletions
@@ -312,7 +312,7 @@ async function authorizeTarget(
const records = await ctx.sessionQuery.filterSessions([
{ kind: 'id', values: [target] },
{ kind: 'cwd', values: [cwd] },
])
], signal)
signal.throwIfAborted()
if (records.length !== 1) throw unauthorizedTarget()
}
@@ -805,7 +805,7 @@ async function authorizeSessionIds(
const records = await ctx.sessionQuery.filterSessions([
{ kind: 'id', values: other },
{ kind: 'cwd', values: [cwd] },
])
], signal)
signal.throwIfAborted()
for (const record of records) authorized.add(record.header.id)
return authorized