mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-16 10:15:10 +00:00
fix(cliproxy): propagate backend parameter to version check functions
Root cause: fetchLatestCliproxyVersion() and checkCliproxyUpdate() ignored the caller's backend selection, always re-computing from config. This caused --update to report wrong version when config wasn't synced. Changes: - Add optional backend param to fetchLatestCliproxyVersion() - Add optional backend param to checkCliproxyUpdate() - Pass effectiveBackend in binary-service.ts calls - Pass backend in cliproxy-stats-routes.ts web endpoints Fixes inconsistent version reporting when switching between CLIProxyAPI (original) and CLIProxyAPIPlus backends.
This commit is contained in:
1 parent
9051ea05bf
commit
2a0efbd954
3 files changed
+16
-12
No files matched your search
@@ -77,7 +77,7 @@ export async function checkLatestVersion(backend?: CLIProxyBackend): Promise<Lat
|
||||
try {
|
||||
// Use checkCliproxyUpdate which is backend-aware (uses correct GitHub repo)
|
||||
const { checkCliproxyUpdate } = await import('../binary-manager');
|
||||
const updateResult = await checkCliproxyUpdate();
|
||||
const updateResult = await checkCliproxyUpdate(effectiveBackend);
|
||||
const latestVersion = updateResult.latestVersion;
|
||||
const currentVersion = getInstalledCliproxyVersion(effectiveBackend);
|
||||
const updateAvailable = latestVersion !== currentVersion;
|
||||
@@ -151,7 +151,7 @@ export async function installLatest(
|
||||
backend ?? loadOrCreateUnifiedConfig().cliproxy?.backend ?? DEFAULT_BACKEND;
|
||||
|
||||
try {
|
||||
const latestVersion = await fetchLatestCliproxyVersion();
|
||||
const latestVersion = await fetchLatestCliproxyVersion(effectiveBackend);
|
||||
const currentVersion = getInstalledCliproxyVersion(effectiveBackend);
|
||||
const wasPinned = isVersionPinned(effectiveBackend);
|
||||
|
||||
|
||||
Reference in new issue
Block a user