fix: start ws disconnected
This commit is contained in:
@@ -130,6 +130,9 @@ export async function runStart({
|
||||
|
||||
attachBackendExitHandler(backendProc, supervisor);
|
||||
|
||||
const healthTimeoutMs = resolveHealthTimeoutMs(HEALTH_TIMEOUT_MS_RELEASE);
|
||||
await waitForHealth(ports.backendUrl, backendProc, healthTimeoutMs);
|
||||
|
||||
// Use standalone server.js directly (not pnpm start)
|
||||
const webUrl = `http://localhost:${ports.webPort}`;
|
||||
launchWebApp({
|
||||
@@ -143,9 +146,6 @@ export async function runStart({
|
||||
quiet: !showOutput,
|
||||
});
|
||||
|
||||
const healthTimeoutMs = resolveHealthTimeoutMs(HEALTH_TIMEOUT_MS_RELEASE);
|
||||
await waitForHealth(ports.backendUrl, backendProc, healthTimeoutMs);
|
||||
|
||||
// Print clean summary
|
||||
console.log("");
|
||||
console.log("[kandev] Server started successfully");
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { useEffect } from 'react';
|
||||
import { fetchBoardSnapshot } from '@/lib/api';
|
||||
import { snapshotToState } from '@/lib/ssr/mapper';
|
||||
import { useAppStoreApi } from '@/components/state-provider';
|
||||
import { useAppStore, useAppStoreApi } from '@/components/state-provider';
|
||||
|
||||
export function useBoardSnapshot(boardId: string | null) {
|
||||
const store = useAppStoreApi();
|
||||
const connectionStatus = useAppStore((state) => state.connection.status);
|
||||
|
||||
useEffect(() => {
|
||||
if (!boardId) return;
|
||||
@@ -13,7 +14,7 @@ export function useBoardSnapshot(boardId: string | null) {
|
||||
store.getState().hydrate(snapshotToState(snapshot));
|
||||
})
|
||||
.catch(() => {
|
||||
// Ignore snapshot errors for now.
|
||||
// Ignore snapshot errors — will retry on WS reconnect.
|
||||
});
|
||||
}, [boardId, store]);
|
||||
}, [boardId, store, connectionStatus]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user