Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(devices): refresh backlogged iOS video and require input admission #18326

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/18326/headmerged by juliusmarminge View on GitHub

Showing 6 changed files with 91 additions and 1 deletion (loading 3).

x
0 of 6 viewed, 6 left
89 additions and 0 deletionsapps/server/src/device/DeviceHubProxy.stream.test.tsAdded
View file
@@ -0,0 +1,89 @@
+import { expect, it } from "@effect/vitest";
+import { NodeWS } from "@effect/platform-node/NodeSocket";
+import * as Context from "effect/Context";
+import * as Effect from "effect/Effect";
+import * as Layer from "effect/Layer";
+import { HttpRouter, HttpServer } from "effect/http";
+import * as NodeHttpServer from "@effect/platform-node/NodeHttpServer";
+import {
+ AuthOrchestrationOperateScope,
+ AuthSessionId,
+ LOCAL_DEVICE_HOST_ID,
+} from "@t3tools/contracts";
+import * as EnvironmentAuth from "../auth/EnvironmentAuth.ts";
+import * as DeviceService from "./DeviceService.ts";
+import * as DeviceHubProxy from "./DeviceHubProxy.ts";
+​
+it.effect("preserves binary input and admission frames through the real socket proxy", () =>
+ Effect.gen(function* () {
+ const hub = yield* Effect.acquireRelease(
+ Effect.sync(() => new NodeWS.WebSocketServer({ port: 0 })),
+ (server) =>
+ Effect.promise(
+ () =>
+ new Promise<void>((resolve) => {
+ for (const client of server.clients) client.terminate();
+ server.close(() => resolve());
+ }),
+ ),
+ );
+ if (!hub.address())