fix(persistence): save service tunnel error state; fix legacy migration; add server label
CI / Build & Test (push) Successful in 2m44s

This commit is contained in:
Raven Scott
2026-02-28 22:00:38 -05:00
parent 6c1428c6f1
commit 4a7399dab8
+4 -1
View File
@@ -157,13 +157,15 @@ function loadState() {
servers: Array.isArray(data.servers) ? data.servers : [],
virtualHosts: Array.isArray(data.virtualHosts) ? data.virtualHosts : [],
serviceTunnels: Array.isArray(data.serviceTunnels) ? data.serviceTunnels : [],
sshConnections: [],
sshConnections: Array.isArray(data.sshConnections) ? data.sshConnections : [],
rdpConnections: Array.isArray(data.rdpConnections) ? data.rdpConnections : [],
nextServerId: typeof data.nextServerId === 'number' ? data.nextServerId : 0,
nextServiceTunnelId: typeof data.nextServiceTunnelId === 'number' ? data.nextServiceTunnelId : 0
};
// Write the new state.json immediately
currentSettings = out.settings;
sshConnectionsList = out.sshConnections;
rdpConnectionsList = out.rdpConnections;
nextServerId = out.nextServerId;
nextServiceTunnelId = out.nextServiceTunnelId;
saveStateSync();
@@ -639,6 +641,7 @@ async function startServiceTunnel(payload) {
} catch (e) {
debugLog('startServiceTunnel: error', e.message);
serviceTunnels.set(tunnelId, { label, hsUrl, localPort, state: 'error', error: e.message, createdAt: Date.now() });
saveStateSync();
emit('serviceTunnelError', { tunnelId, label, error: e.message });
return { ok: false, error: e.message };
}