Skip to content
Source
Sign inSign up
pingdotgg/t3code

Stabilize auth session cookies per server mode #1898

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/1898/headmerged by juliusmarminge View on GitHub

Showing 11 changed files with 88 additions and 3 deletions (loading 8).

x
0 of 11 viewed, 11 left
54 additions and 1 deletionapps/desktop/src/backendPort.test.tsModified
View file
@@ -36,6 +36,57 @@
]);
});
​
+ it("treats wildcard-bound ports as unavailable even when loopback probing succeeds", async () => {
+ const canListenOnHost = vi.fn(async (port: number, host: string) => {
+ if (port === 3773 && host === "127.0.0.1") return true;
+ if (port === 3773 && host === "0.0.0.0") return false;
+ return port === 3774;
+ });
+​
+ await expect(
+ resolveDesktopBackendPort({
+ host: "127.0.0.1",
+ requiredHosts: ["0.0.0.0"],
+ startPort: 3773,
+ canListenOnHost,
+ }),
+ ).resolves.toBe(3774);
+​
+ expect(canListenOnHost.mock.calls).toEqual([
+ [3773, "127.0.0.1"],
+ [3773, "0.0.0.0"],
+ [3774, "127.0.0.1"],
+ [3774, "0.0.0.0"],
+ ]);
+ });
+​
+ it("checks overlapping hosts sequentially to avoid self-interference", async () => {
+ let inFlightCount = 0;