fix(ui): shorten install/uninstall/update timeouts for async RPCs

With the backend flipped to async-spawn, install/uninstall/update return
immediately with a { status, package_id } envelope. Client timeouts of
45m/11m were a leftover from synchronous handlers and masked real RPC
failures.

Drop all install/uninstall/update RPC timeouts to 15s. Progress and
terminal state still arrive through the live state stream — the RPC
only needs to confirm the spawn was accepted.

Return-type annotations updated in rpc-client.ts and stores/server.ts.
Five direct rpcClient.call sites across Marketplace.vue, Discover.vue,
and MarketplaceAppDetails.vue updated with the shorter timeout.
This commit is contained in:
archipelago
2026-04-23 06:58:02 -04:00
parent 1ad889608f
commit 702b5d64d3
5 changed files with 41 additions and 23 deletions

View File

@@ -489,7 +489,7 @@ async function installApp(app: MarketplaceApp) {
try {
const installUrl = app.url || app.manifestUrl || app.s9pkUrl
installingApps.set(app.id, { ...installingApps.get(app.id)!, status: 'downloading', progress: 30, message: 'Downloading package...' })
await rpcClient.call({ method: 'package.install', params: { id: app.id, url: installUrl, version: app.version } })
await rpcClient.call({ method: 'package.install', params: { id: app.id, url: installUrl, version: app.version }, timeout: 15000 })
installingApps.set(app.id, { ...installingApps.get(app.id)!, status: 'installing', progress: 60, message: 'Installing package...' })
startInstallPolling(app.id, 'Starting application...')
} catch (err) {
@@ -511,7 +511,7 @@ async function installCommunityApp(app: MarketplaceApp) {
if ((app as Record<string, unknown>).containerConfig) {
installParams.containerConfig = (app as Record<string, unknown>).containerConfig
}
await rpcClient.call({ method: 'package.install', params: installParams, timeout: 180000 })
await rpcClient.call({ method: 'package.install', params: installParams, timeout: 15000 })
installingApps.set(app.id, { ...installingApps.get(app.id)!, status: 'installing', progress: 60, message: 'Starting container...' })
startInstallPolling(app.id, 'Initializing application...')
} catch (err) {

View File

@@ -418,7 +418,7 @@ async function installApp(app: MarketplaceApp) {
installingApps.set(app.id, { ...installingApps.get(app.id)!, status: 'downloading', progress: 30, message: 'Downloading package...' })
await rpcClient.call({ method: 'package.install', params: { id: app.id, url: installUrl, version: app.version } })
await rpcClient.call({ method: 'package.install', params: { id: app.id, url: installUrl, version: app.version }, timeout: 15000 })
installingApps.set(app.id, { ...installingApps.get(app.id)!, status: 'installing', progress: 60, message: 'Installing package...' })
@@ -447,7 +447,7 @@ async function installCommunityApp(app: MarketplaceApp) {
await rpcClient.call({
method: 'package.install',
params: { id: app.id, dockerImage: app.dockerImage, version: app.version },
timeout: 180000
timeout: 15000
})
installingApps.set(app.id, { ...installingApps.get(app.id)!, status: 'installing', progress: 60, message: 'Starting container...' })

View File

@@ -546,7 +546,7 @@ async function installDependencies() {
id: dep.id,
dockerImage: dep.dockerImage,
},
timeout: 180000,
timeout: 15000,
})
// Wait for package to register before installing next
await new Promise(resolve => setTimeout(resolve, 2000))
@@ -579,7 +579,7 @@ async function installApp() {
dockerImage: app.value.dockerImage,
version: app.value.version,
},
timeout: 180000,
timeout: 15000,
})
} else {
// Package-based installation
@@ -591,6 +591,7 @@ async function installApp() {
url: installUrl,
version: app.value.version,
},
timeout: 15000,
})
}