Fix live chart connection with Reflex 0.10
Fixes #526.
Reflex 0.10 pre-creates the shared Socket.IO manager with autoConnect: false. XY inherits that setting, leaving /_xy inactive and live charts empty.
Activate the namespace explicitly when sharedSocket.active is false. The active guard matters: an already-open legacy manager can have its namespace handshake in flight, so an unconditional connect() sends a duplicate CONNECT. The cached-socket path stays unchanged, preserving app-owned reconnect timing.
Tests
- Six real Socket.IO scenarios pass: warm manager, already-open warm manager, legacy auto-connect, already-open legacy manager, XY-first creation, and unhydrated tokens.
- Covers binary payload dispatch, one shared transport, one namespace CONNECT, repeated mounts, app-owned reconnect/resubscribe, and last-mount cleanup.
- Removing the fix reproduces failures in both warm-manager cases; the four other cases pass.
- Pytest entry point passes; nine existing asset-contract tests pass in isolation.
node js/build.mjs, full-worktree Ruff check/format, and all pre-commit hooks pass.
The regression tests use real Socket.IO peers with React/DOM/ChartView stubs. Local browser painting and the full Python suite were blocked by Chromium's Unix socket restriction and the missing native Rust core, respectively. CI has since passed the repository's native and browser suites; a full compiled Reflex 0.10 app is not part of the new regression test.
CI results
All workflows passed on 08518ea7f75359117d8524703457846aae8c3210: CI, Docs, changelog, and CodSpeed.
- Main Python suite: 4,348 passed, 110 skipped.
- Python 3.11 suite: 3,966 passed, 128 skipped.
- Rust: 137 passed.
- Browser smoke, accessibility/cross-browser conformance, source distribution and platform wheel jobs passed.
Includes the design contract and a news fragment. Socket.IO test dependencies are development-only.