Skip to content

Harden TradingView transport and response-shape handling #54

Description

@bearmug

Problem

The server depends on public TradingView scanner/search endpoints, casts JSON directly to local interfaces, has no bounded retry policy, and accepts invalid environment rate-limit configuration. Endpoint or response-shape changes can yield opaque failures or misleading empty data.

Scope

  • Validate required response shapes at the API boundary.
  • Add bounded retries with backoff for safe transient failures only.
  • Normalize timeout, HTTP, parse, and upstream-shape errors.
  • Validate CACHE_TTL_SECONDS and RATE_LIMIT_RPM at startup with actionable errors.
  • Add tests for malformed responses, retry exhaustion, retry success, timeout, and invalid configuration.

Acceptance criteria

  • Malformed upstream payloads fail explicitly rather than being treated as valid empty results.
  • Retries are bounded, do not retry caller/input errors, and preserve rate-limit safety.
  • Invalid configuration fails before serving requests.
  • Existing live integration behavior remains intact.

Non-goals

No alternate data provider, browser automation, websocket streaming, persistence, or hosted deployment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions