fix(sandbox): avoid sandboxing main DM sessions

This commit is contained in:
Peter Steinberger
2026-01-12 01:23:37 +00:00
parent b9ff4ca1fe
commit 58a12a757e
9 changed files with 207 additions and 109 deletions

View File

@@ -131,6 +131,13 @@ describe("gateway server auth/connect", () => {
{ timeout: 15000 },
async () => {
const { server, ws } = await startServerWithClient();
const closeInfoPromise = new Promise<{ code: number; reason: string }>(
(resolve) => {
ws.once("close", (code, reason) =>
resolve({ code, reason: reason.toString() }),
);
},
);
ws.send(
JSON.stringify({
@@ -164,18 +171,7 @@ describe("gateway server auth/connect", () => {
"invalid connect params",
);
const closeInfo = await new Promise<{ code: number; reason: string }>(
(resolve, reject) => {
const timer = setTimeout(
() => reject(new Error("close timeout")),
3000,
);
ws.once("close", (code, reason) => {
clearTimeout(timer);
resolve({ code, reason: reason.toString() });
});
},
);
const closeInfo = await closeInfoPromise;
expect(closeInfo.code).toBe(1008);
expect(closeInfo.reason).toContain("invalid connect params");