v1.0.382
fix(chat): don't let a flaky boot wipe server-side chat history
Boot hydration marked itself complete even when the GET /api/chat/threads
that feeds it had failed. Over the LAN/VPN that's a routine blip: the client
would hydrate from an empty browser fallback, flip the hydrated flag, and the
next debounced PUT would write {} straight over real server-side history.
Hydration now counts as complete only once the server has actually answered,
and a failed GET retries with backoff (2s, doubling to 30s) instead of giving
up. While unhydrated the client parks state in the localStorage fallback and
sends nothing; the flush fires as soon as hydration lands, so anything typed
during an outage still reaches the server.
Reconciliation moves to mergeThreadsState() — newest write per thread id wins
— so the server's copy beats a stale fallback, an edit made while the server
was unreachable isn't discarded, and threads created mid-hydration survive.
Claude-Session: https://claude.ai/code/session_01FbNUfdN67fEjpg7WdgQpLD