Skip to content

fix: hydration-safe card times, single API pool, keep xenon feed on Futu - #567

Merged
moremeds merged 2 commits into
mainfrom
fix/hydration-pool-race
Oct 24, 2026
Merged

moremeds merged 2 commits into
mainfrom
fix/hydration-pool-race

Conversation

@moremeds

Copy link
Copy Markdown
Owner

Three small fixes.

  • React fix(flash): render helium's typed target and thesis (brief view v2) #418 on the watchlist page. The server (UTC in Docker) and the browser (HKT) formatted card times differently, so hydration failed. The suppressHydrationWarning was one element too high to cover the text. TickerCard now renders UTC until hydrated (useSyncExternalStore), then local time.
  • One API connection pool. get_pool() was a bare lru_cache, which runs the factory once per thread that misses at the same time. Each extra pool leaked connections and threads, and its __del__ failed with "cannot join current thread". A lock serializes the first call. New test tests/unit/api/test_get_pool_single_flight.py fails with 8 pools without the lock.
  • Keep xenon when IB is down but Futu is up. xenon v0.15.0 serves US stocks from Futu during RTH (?quotes=futu-first, now set on the mini) and reports providers.futu in its status frame. The handshake failed over to massive on ib_connected: false alone. It now fails over only when both are down. Indexes still need IB. Known limit: there is no per-symbol failover, so with IB down, pre/after-hours stocks rely on the 120 s quiet watchdog.

Checks: uv run pytest tests/unit/ 3192 passed; xenon failover/consumer + connection pool integration tests 10 passed; ruff clean; web typecheck, eslint, vitest 1603 passed. Browser check with a TZ=UTC server: 0 console errors, cards show HKG times.

🤖 Generated with Claude Code

chenxi added 2 commits October 24, 2026 23:08
TickerCard rendered times in the server zone (UTC) and the browser zone,
so hydration failed (#418); it now renders UTC until hydrated. get_pool()
raced under lru_cache and opened orphan pools whose __del__ failed with
'cannot join current thread'; a lock serializes the first call.
xenon v0.15.0 serves US stocks from Futu during RTH and reports
providers.futu in its status frame. The handshake failed over to massive
on ib_connected=false alone, so an IB logout also dropped Futu.
@moremeds
moremeds merged commit 93e929c into main Oct 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant