Skip to content

TypeScript SDK filterMarkets() includes markets with missing resolutionDate instead of excluding them #1969

Description

@realfishsam

Gap

When a caller filters markets by resolutionDate and a given market has no resolutionDate set, core (and the Python SDK) correctly excludes that market from the results. The TypeScript SDK's reimplementation of this filter does the opposite: it silently lets the market pass the filter.

Core

core/src/BaseExchange.ts:1434-1444 — inside the ResolutionDate filter block: if (criteria.resolutionDate) { const resDate = market.resolutionDate; if (!resDate) return false; ... }. A market with no resolutionDate is explicitly excluded whenever the caller filters on resolutionDate.

TypeScript SDK

sdks/typescript/pmxt/client.ts:3088-3096 — the condition is if (criteria.resolutionDate && market.resolutionDate) { ... }. When market.resolutionDate is falsy, the entire block is skipped, so the market is never excluded and passes the filter instead.

Python SDK

Matches core correctly: sdks/python/pmxt/client.py:2217-2227 explicitly does if not val: continue (excludes) when resolutionDate is missing.

Evidence

Direct read of core/src/BaseExchange.ts:1430-1446 vs sdks/typescript/pmxt/client.ts:3080-3100 vs sdks/python/pmxt/client.py:2217-2227 confirms the TypeScript condition (criteria.resolutionDate && market.resolutionDate) diverges from both core's and Python's (if (!resDate) return false / if not val: continue).

Impact

exchange.filterMarkets(markets, { resolutionDate: {...} }) in the TypeScript SDK silently returns markets that should have been filtered out whenever market.resolutionDate is unset — a data-correctness bug specific to the TypeScript client-side reimplementation of this filter.


Found by automated Core-to-SDK surface coverage audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions