feat(split): Pane B reconnects as soon as the server is back

When SSE comes back after a server restart, handleInit's reconnect
branch already re-opens the primary pane's socket; it now also calls
the split pane tile's reconnectNow(), so Pane B no longer waits out its
backoff (up to 10 s between tries) after every deploy. Live: Pane B was
back 4.6 s after the server process respawned, i.e. as soon as it
listened.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-06 11:03:09 +02:00
parent 497711a05e
commit 9e032bdc3e
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -676,3 +676,16 @@ describe('TerminalTile claims the keyboard for the app-level shortcuts', () => {
expect(term.focusListeners).toEqual([]);
});
});
describe('the server coming back kicks Pane B', () => {
it("handleInit's reconnect branch asks the split pane's tile to reconnect without waiting out its backoff", () => {
// handleInit needs a whole app to run, so the wiring is pinned by source;
// reconnectNow() itself is exercised above.
const appSource = readFileSync(resolve(import.meta.dirname, '../src/web/public/app.js'), 'utf8');
const start = appSource.indexOf('if (keepTerminal && restoreId === previousActiveId');
const branch = appSource.slice(start, appSource.indexOf('} else {', start));
expect(start).toBeGreaterThan(-1);
expect(branch).toContain('this._splitPane?.reconnectNow?.();');
});
});