authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 01:54:36-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 01:54:36-07:00
logee150e178be5e0484a588a8fe7ad98fd6b858973
tree5a70c51dbd3d92c41af08c060639ac447eb6384c
parent0acf05f4f561b873853587f8629ca691b18a613a
signature Signed by PGP key B5690EEEBB952194

refactor(mobile): remove unused cloud relay URL normalizer (#10068)


2 files changed, 0 insertions(+), 16 deletions(-)

apps/mobile/src/features/cloud/linkEnvironment.test.ts-8
...@@ -17,7 +17,6 @@ import {...@@ -17,7 +17,6 @@ import {
17 connectCloudEnvironment,17 connectCloudEnvironment,
18 listCloudEnvironments,18 listCloudEnvironments,
19 listCloudEnvironmentsWithStatus,19 listCloudEnvironmentsWithStatus,
20 normalizeRelayBaseUrl,
21 refreshCloudEnvironmentConnection,20 refreshCloudEnvironmentConnection,
22} from "./linkEnvironment";21} from "./linkEnvironment";
2322
...@@ -195,13 +194,6 @@ describe("mobile cloud link environment client", () => {...@@ -195,13 +194,6 @@ describe("mobile cloud link environment client", () => {
195 loadPreferences.mockClear();194 loadPreferences.mockClear();
196 });195 });
197196
198 it("normalizes configured relay base URLs before building DPoP-bound requests", () => {
199 expect(normalizeRelayBaseUrl(" https://relay.example.test/// ")).toBe(
200 "https://relay.example.test",
201 );
202 expect(normalizeRelayBaseUrl(" ")).toBeNull();
203 });
204
205 it("makes linked environments visible while their status is still loading", () => {197 it("makes linked environments visible while their status is still loading", () => {
206 expect(cloudEnvironmentsPendingStatus([listedEnvironment("env-1")])).toMatchObject([198 expect(cloudEnvironmentsPendingStatus([listedEnvironment("env-1")])).toMatchObject([
207 {199 {
apps/mobile/src/features/cloud/linkEnvironment.ts-8
...@@ -43,14 +43,6 @@ const RELAY_STATUS_AND_CONNECT_SCOPES = [...@@ -43,14 +43,6 @@ const RELAY_STATUS_AND_CONNECT_SCOPES = [
43 RelayEnvironmentConnectScope,43 RelayEnvironmentConnectScope,
44] satisfies ReadonlyArray<RelayDpopAccessTokenScope>;44] satisfies ReadonlyArray<RelayDpopAccessTokenScope>;
4545
46export function normalizeRelayBaseUrl(value: string | null | undefined): string | null {
47 const trimmed = value?.trim();
48 if (!trimmed) {
49 return null;
50 }
51 return trimmed.replace(/\/+$/g, "");
52}
53
54function readRelayUrl(): string | null {46function readRelayUrl(): string | null {
55 return resolveCloudPublicConfig().relay.url;47 return resolveCloudPublicConfig().relay.url;
56}48}