Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(connect): explain DPoP connection failures #8351

Mergedextoci(GitHub profile, opens in a new tab)merged 10 commits intomain fromrefs/pull/8351/headmerged by juliusmarminge View on GitHub

Showing 33 changed files with 107 additions and 54 deletions (loading 31).

x
0 of 33 viewed, 33 left
78 additions and 3 deletionsapps/mobile/src/features/cloud/linkEnvironment.test.tsModified
View file
@@ -4,7 +4,7 @@
import * as Layer from "effect/Layer";
import { EnvironmentId } from "@t3tools/contracts";
import { RelayMobileClientId } from "@t3tools/contracts/relay";
-import { ManagedRelay } from "@t3tools/client-runtime/relay";
+import { DPOP_UNKNOWN_HINT, ManagedRelay } from "@t3tools/client-runtime/relay";
import { remoteHttpClientLayer } from "@t3tools/client-runtime/rpc";
import { HttpClient } from "effect/unstable/http";
import { MobilePreferencesStore } from "../../persistence/mobile-preferences";
@@ -1081,13 +1081,88 @@
).pipe(Effect.flip);
expect(error).toMatchObject({
_tag: "CloudEnvironmentLinkError",
- message:
- "https://relay.example.test/v1/environments/env-1/connect failed: Relay rejected the DPoP proof.",
+ message: `https://relay.example.test/v1/environments/env-1/connect failed: Relay rejected the DPoP proof. ${DPOP_UNKNOWN_HINT}`,
traceId: "trace-connect",
+ it.effect(
+ "presents clock skew as one possible cause when an older environment rejects DPoP",
+ () =>
+ Effect.gen(function* () {
+ vi.stubGlobal(
+ "fetch",
+ vi.fn((url: string | URL) => {
+ const value = String(url);