test(app): workspace tests (#11659)

This commit is contained in:
Filip
2026-02-01 22:39:50 +01:00
committed by GitHub
parent ec720145fa
commit 91f2ac3cb2
7 changed files with 517 additions and 10 deletions

View File

@@ -332,7 +332,9 @@ export namespace Session {
export async function* list() {
const project = Instance.project
for (const item of await Storage.list(["session", project.id])) {
yield Storage.read<Info>(item)
const session = await Storage.read<Info>(item).catch(() => undefined)
if (!session) continue
yield session
}
}
@@ -340,7 +342,8 @@ export namespace Session {
const project = Instance.project
const result = [] as Session.Info[]
for (const item of await Storage.list(["session", project.id])) {
const session = await Storage.read<Info>(item)
const session = await Storage.read<Info>(item).catch(() => undefined)
if (!session) continue
if (session.parentID !== parentID) continue
result.push(session)
}