Skip to content

Address market data review findings#6

Open
SahuRahul wants to merge 2 commits into
mainfrom
fix/market-data-review-items
Open

Address market data review findings#6
SahuRahul wants to merge 2 commits into
mainfrom
fix/market-data-review-items

Conversation

@SahuRahul

Copy link
Copy Markdown
Owner

Implements all fixes documented in planning/MARKET_DATA_REVIEW.md.

Changes

  • stream.py: create the APIRouter inside create_stream_router instead of a module-global — no shared state, no route double-registration if the factory is called twice.
  • massive_client.py: pass a copy of the ticker list into the worker thread so concurrent add/remove on the event loop can't mutate it mid-request.
  • massive_client.py: exponential backoff (capped at 16x) on consecutive poll failures, resetting on success — avoids hammering the API at the base interval on a sustained 429.
  • massive_client.py: document the intentional add_ticker poll latency (conserves rate-limit budget).
  • tests: add tests/market/test_stream.py covering the SSE endpoint.

Verification

  • 77 tests pass (was 73), lint clean
  • Coverage 91% -> 97%; stream.py 33% -> 97%

🤖 Generated with Claude Code

SahuRahul and others added 2 commits June 13, 2026 16:59
- stream.py: create router inside factory (no module-global double-registration)
- massive_client.py: pass ticker-list copy into worker thread (thread safety)
- massive_client.py: exponential backoff on consecutive poll failures (429-safe)
- massive_client.py: document add_ticker poll latency
- tests: add SSE endpoint tests (stream.py coverage 33% -> 97%)

77 tests pass, lint clean, 97% coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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