refactor(app): centralize session state (#33641)

This commit is contained in:
Brendan Allan 2026-06-25 10:16:39 +08:00 committed by GitHub
commit 3b4aaafd41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 865 additions and 1149 deletions

View file

@ -36,4 +36,13 @@ describe("session routes", () => {
}),
).toBe(sessions.root)
})
test("rejects a parent cycle", async () => {
const sessions: Record<string, { id: string; parentID?: string }> = {
child: { id: "child", parentID: "parent" },
parent: { id: "parent", parentID: "child" },
}
expect(rootSession(sessions.child, async (id) => sessions[id]!)).rejects.toThrow("Session parent cycle: child")
})
})