Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): a rejected desktop-local credential is not retried every poll #16273

Mergedjuliusmarmingemerged 8 commits intomain fromrefs/pull/16273/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 70 additions and 0 deletions (loading 3).

x
0 of 4 viewed, 4 left
70 additions and 0 deletionsapps/web/src/connection/platform.test.tsModified
View file
@@ -7,10 +7,17 @@
} from "@t3tools/contracts";
import { describe, expect, it } from "@effect/vitest";
import * as Effect from "effect/Effect";
+import {
+ ConnectionBlockedError,
+ ConnectionTransientError,
+} from "@t3tools/client-runtime/connection";
​
import {
canRetainCachedPlatformRegistrationAfterRefreshFailure,
canReuseCachedPlatformRegistration,
+ isRejectedBootstrapCredentialError,
+ isRejectedSecondaryBootstrap,
+ nextRejectedSecondaryBootstrap,
primaryRegistrationToRetainAfterTopologyRead,
provisionDesktopSshEnvironment,
readPrimaryEnvironmentTargetResult,
@@ -202,6 +209,69 @@
});
});
​
+describe("rejected desktop-local bootstrap tokens", () => {
+ it("backs off on a rejected signature and retries it on a growing, capped delay", () => {
+ const signature = "http://a|ws://a|old-token";
+ const first = nextRejectedSecondaryBootstrap(undefined, signature, 0);
+​
+ expect(isRejectedSecondaryBootstrap(first, signature, 59_999)).toBe(true);
+ // A backend restarted on the same port accepts the same token again, so it is retried.