mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-30 21:23:04 +00:00
fix(app): preserve socket capabilities on adopted probe clients
This commit is contained in:
@@ -76,6 +76,25 @@ describe("test-daemon-connection connectToDaemon", () => {
|
||||
probe = new FakeDaemonProbe();
|
||||
});
|
||||
|
||||
it.each([
|
||||
{ id: "direct:lan:6767", type: "directTcp" as const, endpoint: "lan:6767" },
|
||||
{
|
||||
id: "relay:test",
|
||||
type: "relay" as const,
|
||||
relayEndpoint: "relay.paseo.sh:443",
|
||||
daemonPublicKeyB64: "pubkey",
|
||||
},
|
||||
])("adoptable $type probe clients use the app WebSocket factory", async (connection) => {
|
||||
const { connectToDaemon } = await import("./test-daemon-connection");
|
||||
const { createAppWebSocketFactory } = await import("@/runtime/websocket-factory");
|
||||
const result = await connectToDaemon(connection, { serverId: "srv_probe_test" }, probe.deps);
|
||||
try {
|
||||
expect(result.client.config.webSocketFactory).toBe(createAppWebSocketFactory());
|
||||
} finally {
|
||||
await result.client.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("reuses the app clientId for direct connections", async () => {
|
||||
const { connectToDaemon } = await import("./test-daemon-connection");
|
||||
const first = await connectToDaemon(
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from "@getpaseo/client/internal/daemon-client";
|
||||
import type { DaemonClientConfig } from "@getpaseo/client/internal/daemon-client";
|
||||
import type { HostConnection } from "@/types/host-connection";
|
||||
import { createAppWebSocketFactory } from "@/runtime/websocket-factory";
|
||||
import { getOrCreateClientId } from "./client-id";
|
||||
import { resolveAppVersion } from "./app-version";
|
||||
import {
|
||||
@@ -156,6 +157,7 @@ export async function buildClientConfig(
|
||||
clientType: "mobile" as const,
|
||||
appVersion: deps.resolveAppVersion() ?? undefined,
|
||||
suppressSendErrors: true,
|
||||
webSocketFactory: createAppWebSocketFactory(),
|
||||
reconnect: { enabled: false },
|
||||
...resolveConnectionCredentials(connection, options),
|
||||
...(options.capabilities ? { capabilities: options.capabilities } : {}),
|
||||
|
||||
Reference in New Issue
Block a user