fix: wrap HTTP_SERVER_GET_STATUS response in IpcResult envelope

The HTTP_SERVER_GET_STATUS handler returned a raw { running, port } object
while all other HTTP server handlers (start, stop) return { success, data }.
invokeIpcWithResult() in the preload expects the IpcResult<T> envelope and
treats a missing success field as failure, throwing 'Unknown error'.

This caused an unhandled promise rejection every time the Settings page
opened, because GeneralSection calls api.httpServer.getStatus() on mount.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
proxy 2026-02-21 16:01:14 -05:00
parent 39d88e22a4
commit 8d652c4d2e

View file

@ -310,7 +310,7 @@ function initializeServices(): void {
});
ipcMain.handle(HTTP_SERVER_GET_STATUS, () => {
return { running: httpServer.isRunning(), port: httpServer.getPort() };
return { success: true, data: { running: httpServer.isRunning(), port: httpServer.getPort() } };
});
// Forward SSH state changes to renderer and HTTP SSE clients