Skip to content

Commit c35dc9a

Browse files
fix(server): mirror read errors name the file, not its URL
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent fe66c18 commit c35dc9a

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎apps/server/src/cli/update.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ it.effect("reads the newest version from the update feed file a mirror publishes
108108
// A feed for the wrong track is not trusted to mean the requested one.
109109
assert.include(
110110
yield* resolve("stable", "win32", "x64", "version: 1.5.0-nightly.20261101.2\n"),
111-
"Could not read https://updates.example.com/t3code/latest.yml",
111+
"Could not read latest.yml from Example Corp's update mirror.",
112112
);
113113
assert.include(yield* resolve("preview", "win32", "x64", ""), "has no preview builds");
114114
}),

‎apps/server/src/cli/update.ts‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,15 @@ export const resolveMirrorVersion = Effect.fn("cli.update.resolve_mirror")(funct
108108
});
109109
}
110110
const httpClient = yield* HttpClient.HttpClient;
111-
const url = releaseAssetUrl(
112-
mirror.feedUrl,
113-
updateFeedFileName(
114-
channel === "nightly" ? "nightly" : "latest",
115-
yield* HostProcess.Platform,
116-
yield* HostProcess.Architecture,
117-
),
111+
const fileName = updateFeedFileName(
112+
channel === "nightly" ? "nightly" : "latest",
113+
yield* HostProcess.Platform,
114+
yield* HostProcess.Architecture,
118115
);
116+
const url = releaseAssetUrl(mirror.feedUrl, fileName);
117+
// Not the URL, whose query can hold the mirror's access token.
119118
const unreadable = new CliUpdateError({
120-
reason: `Could not read ${url} from ${mirror.organization}'s update mirror.`,
119+
reason: `Could not read ${fileName} from ${mirror.organization}'s update mirror.`,
121120
});
122121
const body = yield* httpClient.get(url).pipe(
123122
Effect.flatMap(HttpClientResponse.filterStatusOk),

0 commit comments

Comments
 (0)