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:
@@ -100,12 +100,19 @@ export const useServerStore = defineStore('server', () => {
|
||||
const isShuttingDown = computed(() => sync.serverInfo?.['status-info']?.['shutting-down'] || false)
|
||||
const isOffline = computed(() => !sync.isConnected || isRestarting.value || isShuttingDown.value)
|
||||
|
||||
// Package actions
|
||||
async function installPackage(id: string, marketplaceUrl: string, version: string): Promise<string> {
|
||||
// Package actions. install/uninstall/update are async on the backend:
|
||||
// the RPC returns immediately with { status: 'installing'|'removing'|'updating',
|
||||
// package_id } after flipping state, and the real work runs in a spawn.
|
||||
// Progress is streamed via the WebSocket state push, not the RPC response.
|
||||
async function installPackage(
|
||||
id: string,
|
||||
marketplaceUrl: string,
|
||||
version: string,
|
||||
): Promise<{ status: string; package_id: string }> {
|
||||
return rpcClient.installPackage(id, marketplaceUrl, version)
|
||||
}
|
||||
|
||||
async function uninstallPackage(id: string): Promise<void> {
|
||||
async function uninstallPackage(id: string): Promise<{ status: string; package_id: string }> {
|
||||
return rpcClient.uninstallPackage(id)
|
||||
}
|
||||
|
||||
@@ -121,7 +128,7 @@ export const useServerStore = defineStore('server', () => {
|
||||
return rpcClient.restartPackage(id)
|
||||
}
|
||||
|
||||
async function updatePackage(id: string): Promise<{ status: string }> {
|
||||
async function updatePackage(id: string): Promise<{ status: string; package_id: string }> {
|
||||
return rpcClient.updatePackage(id)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user