mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
fix(updater): remove false manual-update enablement promise (#27464)
The legacy remote-server help text promises that one manual update enables remote updates, even when the server reports its updater is unavailable. Replace the promise with accurate host-side update guidance in every supported locale and cover the fallback and specific help branches. Refs #22261 Co-authored-by: Oliver Mee <102673257+oliver-mee@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { RemoteServerUpdateEntry } from '@/runtime/remote-server-update-coordinator'
|
||||
import { getRemoteServerManualUpdateHelp } from './RemoteServerUpdateStatus'
|
||||
|
||||
vi.mock('@/i18n/i18n', () => ({
|
||||
translate: (_key: string, fallback: string) => fallback
|
||||
}))
|
||||
|
||||
const entry: RemoteServerUpdateEntry = {
|
||||
environmentId: 'server-1',
|
||||
name: 'Server',
|
||||
phase: 'manual',
|
||||
currentVersion: '1.4.0',
|
||||
targetVersion: null,
|
||||
progress: null,
|
||||
runtimeId: 'runtime-1',
|
||||
liveTabCount: 0,
|
||||
liveLeafCount: 0,
|
||||
support: null,
|
||||
error: null
|
||||
}
|
||||
|
||||
describe('remote server manual update help', () => {
|
||||
it('does not promise that a manual update enables remote updates when the updater is unavailable', () => {
|
||||
expect(
|
||||
getRemoteServerManualUpdateHelp({
|
||||
...entry,
|
||||
support: { installMode: 'interactive', automatic: false, reason: 'updater-unavailable' }
|
||||
})
|
||||
).toBe('Remote updates are unavailable for this server. Update Orca on the server host.')
|
||||
})
|
||||
|
||||
it('preserves the specific instructions for unsupported installs and development builds', () => {
|
||||
expect(
|
||||
getRemoteServerManualUpdateHelp({
|
||||
...entry,
|
||||
support: {
|
||||
installMode: 'unsupported-headless-serve',
|
||||
automatic: false,
|
||||
reason: 'manual-service-update-required'
|
||||
}
|
||||
})
|
||||
).toContain('service manager')
|
||||
expect(
|
||||
getRemoteServerManualUpdateHelp({
|
||||
...entry,
|
||||
support: { installMode: 'interactive', automatic: false, reason: 'unpackaged-build' }
|
||||
})
|
||||
).toContain('source checkout')
|
||||
})
|
||||
})
|
||||
@@ -107,6 +107,6 @@ export function getRemoteServerManualUpdateHelp(entry: RemoteServerUpdateEntry):
|
||||
}
|
||||
return translate(
|
||||
'auto.components.settings.RemoteServerUpdateStatus.legacyHelp',
|
||||
'Update this server manually once to enable remote updates.'
|
||||
'Remote updates are unavailable for this server. Update Orca on the server host.'
|
||||
)
|
||||
}
|
||||
|
||||
@@ -11774,7 +11774,7 @@
|
||||
"failed": "Update failed",
|
||||
"serviceManagerHelp": "Update Orca on the server host — through its system package manager if it was installed from a .deb or .rpm, otherwise through the service manager that starts it.",
|
||||
"unpackedHelp": "Development builds must be updated from their source checkout.",
|
||||
"legacyHelp": "Update this server manually once to enable remote updates."
|
||||
"legacyHelp": "Remote updates are unavailable for this server. Update Orca on the server host."
|
||||
},
|
||||
"BrowserLinkRoutingSetting": {
|
||||
"description": "Open http(s) links in Orca's built-in browser — from the terminal, markdown, and the editor. {{shortcut}} always uses your system browser.",
|
||||
|
||||
@@ -11541,7 +11541,7 @@
|
||||
"failed": "Update failed",
|
||||
"serviceManagerHelp": "Update Orca through the service manager that starts this server.",
|
||||
"unpackedHelp": "Development builds must be updated from their source checkout.",
|
||||
"legacyHelp": "Update this server manually once to enable remote updates."
|
||||
"legacyHelp": "Las actualizaciones remotas no están disponibles para este servidor. Actualiza Orca en el servidor."
|
||||
},
|
||||
"BrowserLinkRoutingSetting": {
|
||||
"description": "Abre los enlaces http(s) del terminal, Markdown y el editor en el navegador integrado de Orca. {{shortcut}} siempre usa el navegador del sistema.",
|
||||
|
||||
@@ -11625,7 +11625,7 @@
|
||||
"failed": "Échec de la mise à jour",
|
||||
"serviceManagerHelp": "Mettez à jour Orca via le gestionnaire de services qui démarre ce serveur.",
|
||||
"unpackedHelp": "Les builds de développement doivent être mis à jour depuis leur checkout source.",
|
||||
"legacyHelp": "Mettez à jour ce serveur une fois manuellement pour activer les mises à jour à distance."
|
||||
"legacyHelp": "Les mises à jour à distance ne sont pas disponibles pour ce serveur. Mettez Orca à jour sur le serveur."
|
||||
},
|
||||
"BrowserLinkRoutingSetting": {
|
||||
"description": "Ouvre les liens http(s) dans le navigateur intégré d'Orca — depuis le terminal, le markdown et l'éditeur. {{shortcut}} utilise toujours votre navigateur système.",
|
||||
|
||||
@@ -11541,7 +11541,7 @@
|
||||
"failed": "更新に失敗しました",
|
||||
"serviceManagerHelp": "このサーバーを開始するサービスマネージャーを通じて Orca を更新してください。",
|
||||
"unpackedHelp": "開発ビルドはソースチェックアウトから更新する必要があります。",
|
||||
"legacyHelp": "リモート更新を有効にするには、このサーバーを一度手動で更新してください。"
|
||||
"legacyHelp": "このサーバーではリモート更新を利用できません。サーバー上で Orca を更新してください。"
|
||||
},
|
||||
"BrowserLinkRoutingSetting": {
|
||||
"description": "ターミナル、Markdown、エディターの http(s) リンクを Orca の組み込みブラウザで開きます。{{shortcut}} は常にシステムブラウザを使用します。",
|
||||
|
||||
@@ -11541,7 +11541,7 @@
|
||||
"failed": "업데이트 실패",
|
||||
"serviceManagerHelp": "이 서버를 시작하는 서비스 관리자를 통해 Orca를 업데이트하세요.",
|
||||
"unpackedHelp": "개발 빌드는 소스 체크아웃에서 업데이트해야 합니다.",
|
||||
"legacyHelp": "원격 업데이트를 활성화하려면 이 서버를 수동으로 한 번 업데이트하세요."
|
||||
"legacyHelp": "이 서버에서는 원격 업데이트를 사용할 수 없습니다. 서버에서 Orca를 업데이트하세요."
|
||||
},
|
||||
"BrowserLinkRoutingSetting": {
|
||||
"description": "터미널, Markdown, 편집기의 http(s) 링크를 Orca 내장 브라우저에서 엽니다. {{shortcut}}을(를) 누르면 항상 시스템 브라우저를 사용합니다.",
|
||||
|
||||
@@ -11541,7 +11541,7 @@
|
||||
"failed": "更新失败",
|
||||
"serviceManagerHelp": "通过启动此服务器的服务管理器更新 Orca。",
|
||||
"unpackedHelp": "开发版本必须从其源代码检出进行更新。",
|
||||
"legacyHelp": "手动更新此服务器一次以启用远程更新。"
|
||||
"legacyHelp": "此服务器无法远程更新。请在服务器主机上更新 Orca。"
|
||||
},
|
||||
"BrowserLinkRoutingSetting": {
|
||||
"description": "在 Orca 内置浏览器中打开来自终端、Markdown 和编辑器的 http(s) 链接。{{shortcut}} 始终使用系统浏览器。",
|
||||
|
||||
Reference in New Issue
Block a user