Skip to content

Missing timeout: Limitless — HttpClient instantiated without timeout in fetcher.ts (2 call sites) #680

@realfishsam

Description

@realfishsam

Location

core/src/exchanges/limitless/fetcher.ts:102 and core/src/exchanges/limitless/fetcher.ts:262

Code

Call site 1 — market fetching (fetchRawMarkets)

const httpClient = new HttpClient({
    baseURL: this.apiUrl,
    apiKey: this.apiKey,
});
const marketFetcher = new MarketFetcher(httpClient);

Call site 2 — event fetching (fetchRawEventBySlug)

const httpClient = new HttpClient({ baseURL: this.apiUrl });
const marketFetcher = new MarketFetcher(httpClient);

Risk

Both HttpClient instances are created without a timeout option. If the Limitless API hangs or stalls, fetchMarkets(), fetchEvents(), and fetchEvent() block indefinitely — stalling the sidecar handler thread for that exchange slot.

Note: limitless/client.ts:58 and limitless/auth.ts:78 already set timeout: 30000 on their HttpClient instances. These two in fetcher.ts are the inconsistent gap.

Affected Methods

  • fetchMarkets() — calls fetchRawMarkets() → creates client at line 102
  • fetchEvents() — calls fetchRawEvents() → calls fetchRawEventBySlug() → creates client at line 262
  • fetchEvent() — same path as above

Suggested Fix

// line 102
const httpClient = new HttpClient({
    baseURL: this.apiUrl,
    apiKey: this.apiKey,
    timeout: 30000,
});

// line 262
const httpClient = new HttpClient({ baseURL: this.apiUrl, timeout: 30000 });

Found by automated missing timeout audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions