Skip to content
TypeScript

refactor(mobile): remove unused pairing redaction wrapper (#10147)

Julius Marminge6a8f4d3b8f1c
diff --git a/apps/mobile/src/lib/connection.test.ts b/apps/mobile/src/lib/connection.test.ts
index 6487e572c87..6cc9ce8607d 100644
--- a/apps/mobile/src/lib/connection.test.ts
+++ b/apps/mobile/src/lib/connection.test.ts
@@ -1,11 +1,7 @@
import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { EnvironmentId } from "@t3tools/contracts";
-import {
- isRelayManagedConnection,
- redactPairingCredential,
- toStableSavedRemoteConnection,
-} from "./connection";
+import { isRelayManagedConnection, toStableSavedRemoteConnection } from "./connection";
import { authClientMetadata } from "./authClientMetadata";
const mobilePlatform = vi.hoisted(() => ({ OS: "ios" as "ios" | "android" }));
@@ -83,23 +79,6 @@ describe("mobile remote connection records", () => {
});
});
- it("removes one-time bootstrap credentials before persisting pairing URLs", () => {
- expect(redactPairingCredential("https://desktop.example/#token=bootstrap-token")).toBe(
- "https://desktop.example/",
- );
- expect(redactPairingCredential("https://desktop.example/?token=bootstrap-token")).toBe(
- "https://desktop.example/",
- );
- });
-
- it("removes hosted pairing credentials while keeping the advertised host", () => {
- expect(
- redactPairingCredential(
- "https://app.t3.codes/pair?host=https%3A%2F%2Fdesktop.example&token=bootstrap-token&label=Desktop",
- ),
- ).toBe("https://app.t3.codes/pair?host=https%3A%2F%2Fdesktop.example&label=Desktop");
- });
-
it("recognizes explicitly managed relay connections", () => {
expect(isRelayManagedConnection({ relayManaged: true })).toBe(true);
});
diff --git a/apps/mobile/src/lib/connection.ts b/apps/mobile/src/lib/connection.ts
index df26a192cd0..5919a805ddd 100644
--- a/apps/mobile/src/lib/connection.ts
+++ b/apps/mobile/src/lib/connection.ts
@@ -1,5 +1,4 @@
import { EnvironmentId } from "@t3tools/contracts";
-import { stripPairingTokenFromUrl } from "@t3tools/shared/remote";
import { type EnvironmentConnectionPhase } from "@t3tools/client-runtime/connection";
export interface SavedRemoteConnection {
@@ -17,15 +16,6 @@ export interface SavedRemoteConnection {
export type RemoteClientConnectionState = EnvironmentConnectionPhase;
-export function redactPairingCredential(pairingUrl: string): string {
- const trimmed = pairingUrl.trim();
- try {
- return stripPairingTokenFromUrl(new URL(trimmed)).toString();
- } catch {
- return trimmed;
- }
-}
-
export function isRelayManagedConnection(
connection: Pick<SavedRemoteConnection, "authenticationMethod" | "relayManaged">,
): boolean {