fix(session-query): close review edge cases (round 4)

This commit is contained in:
Hypatia May
2026-07-17 09:39:39 +08:00
parent 92fd92fa69
commit 75e9958f11
12 changed files with 213 additions and 51 deletions
@@ -145,17 +145,21 @@ export class SessionPersistenceJsonl extends SessionPersistence implements Persi
async listSnapshots(): Promise<SessionPersistenceSnapshot[]> {
const snapshots: SessionPersistenceSnapshot[] = []
for (const artifact of await this.listArtifacts()) {
const identity = await stat(artifact.path, { bigint: true })
snapshots.push({
header: artifact.header,
revision: SessionPersistenceRevision([
identity.dev,
identity.ino,
identity.size,
identity.mtimeNs,
identity.ctimeNs,
].join(':')),
})
try {
const identity = await stat(artifact.path, { bigint: true })
snapshots.push({
header: artifact.header,
revision: SessionPersistenceRevision([
identity.dev,
identity.ino,
identity.size,
identity.mtimeNs,
identity.ctimeNs,
].join(':')),
})
} catch (error: unknown) {
if (!isENOENT(error)) throw error
}
}
return snapshots
}